Showing posts with label proxy. Show all posts
Showing posts with label proxy. Show all posts

Friday, April 8, 2016

Simple WPAD script for direct connection to anything local

Below is a simple wpad script to let users have direct connection to anything local and the rest through proxy. You can continue to add statements but remember to add the corresponding brackets and the start and end.

Explanation

isPlainHostName(host) - the destination hostname. Any plain hostname (without FQDN) will be going direct

isInNet(myIpAddress() - the source address. This may be a local network where you do not want the users to use the proxy.

isInNet(host) - the destination address. The three shown are all the private address
function FindProxyForURL(url, host)
{
if (((((isPlainHostName(host) ||
dnsDomainIs(host, ".yourlocaldomain.com") ||
isInNet(myIpAddress(), "x.x.x.x", "m.m.m.m") ||
isInNet(host, "10.0.0.0", "255.0.0.0") ||
isInNet(host, "172.16.0.0", "255.240.0.0") ||
isInNet(host, "192.168.0.0", "255.255.0.0"))))))
return "DIRECT";
else return "PROXY your-proxy-server-ip:3128";
}

Thursday, September 12, 2013

Clearing Squid cache

I ran into some problems and found out that the cache was the culprit. After reading a few documentation which differs from one another on which is the right way to clear the cache, and after performing them myself, I found that the following is the best way

1. Find out where your Squid is storing the cache. Different distro saves in a different location. To do this, look in the /etc/squid/squid.conf file and search for 'cache' line.

2. Stop squid

3. Remove Squid cache content from the folder eg rm -rf /var/spool/squid/*

4. Recreate the cache internal folders with the Squid script - squid -z

5. Restart Squid.


Friday, November 7, 2008

How to block Windows Live Messenger with Squid

Most network administrators don't really care if the users waste their time chatting away on the net. It's not their job to make sure that users are productive. That is up to their respective department managers to decide.

However, for most administrators, P2P programs such as Windows Live Messenger are security risk as it has the capabilities of files transfer. With that, any form of files, inclusive of damaging scripts etc can get into the network.Users can always claim ignorance but network administrators do not have that luxury

If you are using squid as a proxy and would like to block your users from using Windows Live Messenger, you can take the example from the following ACLs

# Windows Live Messenger
acl wlm_mimetype req_mime_type -i ^application/x-msn-messenger$
acl wlm_urlregex url_regex -i gateway.dll
http_access deny wlm_mimetype
http_access deny wlm_urlregex