Question with ACL and UrlRewrite ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question with ACL and UrlRewrite ?

Aismel

Hi,

 

I need allow  all my users navigate through internet but starting at 14:00pm to 20:00pm to X pages only so before no one can access to that X pages.

 

I need redirect when a user ask www.facebook.com to m.facebook.com

 

I found this script but do not why don’t work

 

#!/usr/bin/perl

$mirror = "m.facebook.com";

 

$| = 1;

while (<>) {

    @line = split;

    $_ = $line[0];

    if (m/^http:\/\/((?:[a-z0-9]+\.)?\.facebook\.com)\/(.*)/ &&

        $1 ne $mirror) {

        print "http://" . $mirror . "/" . $2 . "\n";

    } else {

        print $_ . "\n";

    }

}

 

Pd: I set the chmod +x to the script.

 

Thanks any help

 

Best regards


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Question with ACL and UrlRewrite ?

Yuri Voinov

May be, because of FB is some years ago under HTTPS?


17.01.2018 03:17, Aismel пишет:

Hi,

 

I need allow  all my users navigate through internet but starting at 14:00pm to 20:00pm to X pages only so before no one can access to that X pages.

 

I need redirect when a user ask www.facebook.com to m.facebook.com

 

I found this script but do not why don’t work

 

#!/usr/bin/perl

$mirror = "m.facebook.com";

 

$| = 1;

while (<>) {

    @line = split;

    $_ = $line[0];

    if (m/^<a class="moz-txt-link-freetext" href="http:\/\/((">http:\/\/((?:[a-z0-9]+\.)?\.facebook\.com)\/(.*)/ &&

        $1 ne $mirror) {

        print <a class="moz-txt-link-rfc2396E" href="http://">"http://" . $mirror . "/" . $2 . "\n";

    } else {

        print $_ . "\n";

    }

}

 

Pd: I set the chmod +x to the script.

 

Thanks any help

 

Best regards



_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users

-- 
*****************************
* C++20 : Bug to the future *
*****************************

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

RV: Question with ACL and UrlRewrite ?

Aismel

I was reading that it is necessary to make the function of man in the middle to be able to issue a security certificate ....

Question: The proxy does not act as such, because it is so complicated to change the user's request when 50% of the work is already done.

Someone has some other solution ...


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: RV: Question with ACL and UrlRewrite ?

Amos Jeffries
Administrator
On 18/01/18 07:50, Aismel wrote:
> I was reading that it is necessary to make the function of man in the
> middle to be able to issue a security certificate ....
>
> Question: The proxy does not act as such, because it is so complicated
> to change the user's request when 50% of the work is already done.
>
> Someone has some other solution ...
>


Yuri was referring to how your re-writer is looking for URLs that start
with the exact string "http://". But Facebook and many others no longer
use URLs that start that way.

No matter what you do to get the traffic, the helper needs to check for
the real URLs if it is to do anything useful.



MITM is necessary to issue certificates for domains *belonging to other
people or companies*. Re-writing URLs is very much *not* a good thing to
do. It is possible, just not wise.

Part of the MITM often involves guaranteeing that the decoded traffic
continues to go to the place it was already going. That and things like
it place limitations different from http://

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users