Hot answers tagged squid
5
Netcat is not a specialized HTTP client. Connecting through a proxy server for Netcat thus means creating a TCP connection through the server, which is why it expects a SOCKS or HTTPS proxy with the -x argument, specified by -X:
-X proxy_protocol
Requests that nc should use the specified protocol when talking
to the proxy server. ...
4
This may not be the best solution, but if you use any proxy then it will have a specific host:port so the netcat solution with still work, albeit you'll have to pick apart the proxy meta-data to make sense of it.
The easiest way to do this might be to use any random anonymization proxy out there and just channel all the traffic through netcat. (I.e., set ...
3
Both Perl and Python (and probably Ruby as well) have simple kits that you can use to quickly build simple HTTP proxies.
In Perl, use HTTP::Proxy. Here's the 3-line example from the documentation. Add filters to filter, log or rewrite requests or responses; see the documentation for examples.
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new( port => ...
3
Depending on which browser you are using, using a proxy auto-config file might work best. Most modern browsers will support this.
Something like this should be a good start:
function FindProxyForURL(url, host) {
isp = "PROXY ip_address:port; DIRECT";
tor = "SOCKS 127.0.0.1:9050";
if (shExpMatch(host,"*.onion")) {
return tor;
}
...
2
It sounds like it needs to startup later in the boot sequence. Maybe it is binding to the wrong interface or the interface you use is not available when it starts. Check the system startup logs for any messages squid is telling you when it firs starts, then consider changing the startup script priority number.
You could also set a reboot in your rc.local ...
2
You want to block any and all HTTPS sites? You need to do this with a firewall on your router. Blocking it in Squid won't prevent people from circumventing it unless the firewall on your router also blocks it. If your router blocks it than what squid does is irrelevant. Better yet, set the firewall to block all outgoing TCP connections except for port 80 ...
2
I can answer how to manage the bandwidth once you know what IP is in which group. You can use hierarchical token bucket to allocate three groups.
10 Group A
20 Group B
30 Unknown traffic for/from non-AD devices in your network
#Create egress shaping
$TC qdisc add dev eth0 root handle 1: htb default 20 r2q 50
$TC class add dev eth0 parent 1: classid 1:1 ...
2
You can't make everything transparent with Squid. Only HTTP can be transparent and HTTPS with a non recommended hack. For FTP, you need a pure FTP proxy like Frox.
Anyway, it doesn't make any sense to use proxies if you want to make everything transparent, use NAT.
HTTP could be useful only because the cache.
2
Put this in your squid.conf
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
# acl lan src 192.168.1.1 192.168.2.0/24 # configure this for your lan settings
http_access allow localhost
http_access allow lan
and make sure you have setup the iptables on your squid server.
iptables -t nat -A PREROUTING ...
1
Create a file /etc/squid/white.acl
Put the following data there:
finam.ru/analysis/.*
finam.ru/.*\.js
finam.ru/.*\.css
Put this code into squid.conf. You have to put the whitelist before the blacklist:
acl good_url url_regex "/etc/squid/white.acl"
http_access allow good_url
acl bad_url url_regex "/etc/squid/block.acl"
http_access deny bad_url
1
dns_nameservers 182.190.0.21 182.176.39.17 192.168.1.100
#broken_vary_encoding allow apache
#extension_methods REPORT MERGE MKACTIVITY CHECKOUT
#acl M1 arp 00:18:8B:28:DD:7F
#acl M2 arp 00:21:9b:d3:d8:de
#http_access allow M1
#http_access allow M2
#http_access deny all
#http_port 80
#httpd_accel_host 127.0.0.1
#http_accel_port 80
http_port 80 accel ...
1
You must combine your ACLs on a single http_access line like this:
http_access allow allow_tutorial tutorial
http_access deny allow_tutorial
By setting ACLs this way you are telling squid:
If any IP from ACL allow_tutorial tries to visit any URL from ACL tutorial allow it
If any IP from ACL allow_tutorial tries to visit any URL deny it
1
Just read the squid.conf file. The default installation on Ubuntu only works for localhost. You will need to set up an ACL to enable access. This can include any address or address you choose.
You may want to review instructions for Setting up a Squid Proxy on Ubuntu. They should be applicable to most platforms.
Only top voted, non community-wiki answers of a minimum length are eligible
