Coder Social home page Coder Social logo

diladele / squid-windows Goto Github PK

View Code? Open in Web Editor NEW
178.0 23.0 40.0 505.13 MB

Squid Proxy built for Microsoft Windows

License: GNU General Public License v2.0

Python 10.09% Shell 7.39% CSS 1.73% Perl 52.29% C# 28.28% Batchfile 0.22%
squid ssl-inspection https-filtering

squid-windows's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

squid-windows's Issues

Service status feedback and resiliency improvement suggestion

Squid service (Diladele.Squid.Service.exe) appears to be a launcher and does not reflect the health status of the squid processes. If for some reason one of the squid process dies (or even if they all die), Squid service keeps a "running" status and does not reflect the proxy state.

It should probably be better if Squid service launcher periodically polled the squid processes responsiveness / status, to be able either to try to restart it/them or at least to reflect their state to the operating system (and monitoring agents if any) by stopping itself (and remaining squid processes if any) in case of problem. At least OS or third party jobs should be able to restart it.

add a command line in order to run squid -z

Currently running squid -z from a command line causes a crash, because some of the libraries cannot be found. As a workaround the user has to set the PATH variable in the shell to the bin directory, i.e.
set PATH=C:\Program Files\Squid\bin;%PATH%

We should create a command shortcut with already correct PATH set.

FTP over HTTP problem

When using FTP over HTTP (ftp://... url in regular browser), Squid is extremely slow to generate each folder display page.

The reason can be found in cache.log : squid tries to get its graphical icons (folder.png, arrow_up.png, ...) from the remote FTP server currently accessed, instead of the local machine. It mixes local path and remote host.

For instance (from cache.log) :
(...)
2015/05/11 21:46:29 kid1| internalStart: unknown request:
GET /squid-internal-static/icons/silk/folder.png HTTP/1.1
Host: ftp.skynet.be
(...)

Each time an icon is needed to compose the page, the problem occurs. The resulting page does not contain the icon, and the generation is extremely slow.

Adding parameter "short_icon_urls off" to squid.conf only partially fixes the problem : icons are back in the displayed page, but generation is still slow and errors in cache.log remain. For some reason squid continues to mix local path and remote host, but manages however to get the icon(s) in the end... ?

Crash of the tray on windows 2008 R2 64

Installed 3.5.5 on Server 2008 R2 x64. At login SquidTray crashes and windows gives the following minimal output. I can live without SquidTray anyway but thought I should report it.

I did have 3.5.1 working previously.
MarkJ


Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: diladele.squid.tray.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 55715464
Problem Signature 04: mscorlib
Problem Signature 05: 2.0.0.0
Problem Signature 06: 53a11de1
Problem Signature 07: 123f
Problem Signature 08: 5f
Problem Signature 09: System.IO.FileNotFoundException
OS Version: 6.1.7601.2.1.0.272.7
Locale ID: 3081

Delaypool not work in this version.

Could be recompiled in order delaypool features could work to limit bandwidth client squid? Or did in previous versions of that works its delaypool features?

Failes to create cache dir with 2015/10/13 22:40:58| assertion failed: Kid.cc:45: "cpid > 0"

The squid package (3.5.9 and 3.5.10 tried) installs itself to F:\squid.
It is automatically chosen and fine, it is the biggest drive.
It seems to work too.
Then I add:
cache_dir aufs /cygdrive/f/Squid/var/squid/cache 93000 16 256
Then I am supposed to run (just as I am used on Linux squid):
squid -z
Result in the log file:
2015/10/13 22:47:06| assertion failed: Kid.cc:45: "cpid > 0"

The variant:
cache_dir aufs /cygdrive/f/Squid/var/squid/cache 13000 16 256
does not work either, squid -z does not create the directories.

F:\Squid\bin>squid -z -f /cygdrive/f/Squid/etc/squid/squid.conf

doesn't do what it should too...

This is the cache.log from trying with 3.5.9:

2015/10/13 22:48:38 kid1| Set Current Directory to /var/cache/squid
2015/10/13 22:48:38 kid1| Starting Squid Cache version 3.5.9-20150922-r13918 for x86_64-unknown-cygwin...
2015/10/13 22:48:38 kid1| Service Name: squid
2015/10/13 22:48:38 kid1| Process ID 7348
2015/10/13 22:48:38 kid1| Process Roles: worker
2015/10/13 22:48:38 kid1| With 3200 file descriptors available
2015/10/13 22:48:38 kid1| Initializing IP Cache...
2015/10/13 22:48:38 kid1| parseEtcHosts: /etc/hosts: (2) No such file or directory
2015/10/13 22:48:38 kid1| DNS Socket created at [::], FD 5
2015/10/13 22:48:38 kid1| DNS Socket created at 0.0.0.0, FD 6
2015/10/13 22:48:38 kid1| Adding nameserver 8.8.8.8 from squid.conf
2015/10/13 22:48:38 kid1| Adding nameserver 208.67.222.222 from squid.conf
2015/10/13 22:48:38 kid1| Logfile: opening log daemon:/var/log/squid/access.log
2015/10/13 22:48:38 kid1| Logfile Daemon: opening log /var/log/squid/access.log
2015/10/13 22:48:38 kid1| WARNING: no_suid: setuid(0): (22) Invalid argument
2015/10/13 22:48:38 kid1| Store logging disabled
2015/10/13 22:48:38 kid1| Swap maxSize 13312000 + 262144 KB, estimated 1044164 objects
2015/10/13 22:48:38 kid1| Target number of buckets: 52208
2015/10/13 22:48:38 kid1| Using 65536 Store buckets
2015/10/13 22:48:38 kid1| Max Mem size: 262144 KB
2015/10/13 22:48:38 kid1| Max Swap size: 13312000 KB
2015/10/13 22:48:38 kid1| ERROR: /cygdrive/f/Squid/var/squid/cache: (2) No such file or directory
FATAL: Failed to verify one of the swap directories, Check cache.log
for details. Run 'squid -z' to create swap directories
if needed, or if running Squid for the first time.
Squid Cache (Version 3.5.9-20150922-r13918): Terminated abnormally.
CPU Usage: 0.061 seconds = 0.015 user + 0.046 sys
Maximum Resident Size: 1222656 KB
Page faults with physical i/o: 4869

But the directory IS THERE... (copy paste from explorer):
F:\Squid\var\cache\squid
There is also no security problem for file access, since the whole drive is set to be read-writable be "everyone".

OS is Windows 10 x64, other cygwin "portings", i.e. collect program with the dependencies work fine.

I cannot see why cache_dir failes, without that directive it works, but is is completely useless without a disk cache.

Squid MSI should add the following as squid.conf.diladele in /etc/squid

#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80      # http
acl Safe_ports port 21      # ftp
acl Safe_ports port 443     # https
acl Safe_ports port 70      # gopher
acl Safe_ports port 210     # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280     # http-mgmt
acl Safe_ports port 488     # gss-http
acl Safe_ports port 591     # filemaker
acl Safe_ports port 777     # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# squid settings managed by Diladele Web Safety
include "/cygdrive/c/programdata/Diladele/DiladeleWebSafety/4.0/etc/squid/squid.acl"

# Squid normally listens to port 3128
http_port 3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/myca.pem

# certificate storage
sslcrtd_program /lib/squid/ssl_crtd -s /var/cache/squid_ssldb -M 4MB

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/cache/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:       1440    20% 10080
refresh_pattern ^gopher:    1440    0%  1440
refresh_pattern -i (/cgi-bin/|\?) 0 0%  0
refresh_pattern .       0   20% 4320

dns_nameservers 8.8.8.8 208.67.222.222

# integration with Diladele Web Safety for Squid for Windows
icap_enable on
icap_preview_enable on
icap_preview_size 4096
icap_persistent_connections on
icap_send_client_ip on
icap_send_client_username on
icap_client_username_header X-Client-Username
icap_service_failure_limit -1
icap_service qlproxy1 reqmod_precache bypass=0 icap://127.0.0.1:1344/reqmod
icap_service qlproxy2 respmod_precache bypass=0 icap://127.0.0.1:1344/respmod
acl qlproxy_icap_edomains dstdomain "/cygdrive/c/programdata/Diladele/DiladeleWebSafety/4.0/etc/squid/icap_exclusions_domains.conf" 
acl qlproxy_icap_etypes rep_mime_type "/cygdrive/c/programdata/Diladele/DiladeleWebSafety/4.0/etc/squid/icap_exclusions_contenttypes.conf"
adaptation_access qlproxy1 deny qlproxy_icap_edomains
adaptation_access qlproxy2 deny qlproxy_icap_edomains
adaptation_access qlproxy2 deny qlproxy_icap_etypes
adaptation_access qlproxy1 allow all
adaptation_access qlproxy2 allow all

Squid3 runs out of file descriptors

Hi
I have sometimes trouble with your build with Squid3 (with cache enabled)
I says it runs out of file descriptors
Because of that, it sometimes doesn't load whole images (partly downloaded)
can you compile it with more file descriptors?
I think you can compile it with the option "--with-maxfd=[and some numbers]" try with number 65536
It can also decrease it for max supported (in cygwin)
I hope the build you next release will be better

Installing on Windows server 2012

While installing the msi on Windows Server 2012, I get the error message "This product required Microsoft .Net 2.0 to be installed on this machine." Windows server 2012 comes with .net 4.5 pre installed.

Default install location Z drive

I have an m3.medium EC2 instance in AWS that I'm trying to automatically (i.e. non-interactively) install Squid on.

This instance has an ephemeral drive automatically mapped to Z.

Via the MSI, Squid insists on installing to Z.

It does this regardless of whether I override ROOTDRIVE, INSTALLDIR, TARGETFOLDER or any of the other variables that you can set via MSIEXEC.

Any ideas?

MSI - no upgrade

You MSI haven't upgrade option, and rolled back installation without any reasonable reasons and errors diagnostics.

Is it possible to use basic_db_auth?

2015/11/10 17:32:07 kid1| helperOpenServers: Starting 1/5 'basic_db_auth' processes
2015/11/10 17:32:07 kid1| WARNING: no_suid: setuid(0): (22) Invalid argument
2015/11/10 17:32:07 kid1| ipcCreate: /lib/squid/basic_db_auth: (13) Permission denied
2015/11/10 17:32:07 kid1| WARNING: basicauthenticator #Hlpr1091 exited

32 bit installer

Hi,

Our server is running on a 32 bit windows, there is any plan to release a 32bit MSI installer?

Is there any 32 bit verson?

Hi, I only found 64 bit version installer to download, is there any 32 bit one? I'm having an old windows XP.

Cache

Having trouble using the cache set up, I have it set as

/cygdrive/c/Squid/var/cache/squid/

I then stop the squid service, go to the squid-bin directory in command prompt (as administrator) and type 'squid -z' then I start the squid service again.

The problem is that it continuosly likes to complain about the fact that it can't find the cachedir '00' and that I should run 'squid -z' even though I have multiple times.

disk cache path needs commenting to give correct path example

I spent ages trying to get my disk cache going on d drive.

Previously using squidnt and just used format similar to:

cache_dir d:/squid/cache 3000 16 256 (i.e. only change from msdos paths is forward slashes)

After a nice email from Raf, with a link to the relevant page, i came to learn that the correct format is:

cache_dir aufs /cygdrive/d/squid/cache 3000 16 256

Can you please update the comment line in the default squid.conf to reflect this

Something like:

uncomment the line below to enable disk caching - path format is /cygdrive//path to cache folder

cache_dir aufs /cygdrive/d/squid/cache 3000 16 256

It will save Raf having to direct people to a link to a page that i couldnt find myself :)

How to integrate DDWS with Squid for Windows

# integration with Diladele Web Safety for Squid for Windows
icap_enable on
icap_preview_enable on
icap_preview_size 4096
icap_persistent_connections on
icap_send_client_ip on
icap_send_client_username on
icap_client_username_header X-Client-Username
icap_service_failure_limit -1
icap_service qlproxy1 reqmod_precache bypass=0 icap://127.0.0.1:1344/reqmod
icap_service qlproxy2 respmod_precache bypass=0 icap://127.0.0.1:1344/respmod
acl qlproxy_icap_edomains dstdomain "/cygdrive/c/programdata/Diladele/DiladeleWebSafety/4.0/etc/squid/icap_exclusions_domains.conf" 
acl qlproxy_icap_etypes rep_mime_type "/cygdrive/c/programdata/Diladele/DiladeleWebSafety/4.0/etc/squid/icap_exclusions_contenttypes.conf"
#acl qlproxy_icap_edomains dstdomain "/cygdrive/c/programdata/Diladele/Diladele Web Safety/4.0/etc/squid/icap_exclusions_domains.conf" 
#acl qlproxy_icap_etypes rep_mime_type "/cygdrive/c/programdata/Diladele/Diladele Web Safety/4.0/etc/squid/icap_exclusions_contenttypes.conf"
adaptation_access qlproxy1 deny qlproxy_icap_edomains
adaptation_access qlproxy2 deny qlproxy_icap_edomains
adaptation_access qlproxy2 deny qlproxy_icap_etypes
adaptation_access qlproxy1 allow all
adaptation_access qlproxy2 allow all

Installation and uninstallation improvement suggestion

Installation improvement :

As installation script automatically installs and adapts squid.conf file and automatically creates inbound rule in the firewall, if should be convenient to offer proxy port modification at install (with 3128 as default value)

Uninstallation improvement :

Uninstallation deletes squid.conf file without warning, but leaves other files / folders behind. It should be more convenient to offer the possibility to delete squid.conf optionally and to delete all other files currently left untouched.

Default installer path

The current default install path is in c:\program files. This is not ideal as any edit to the squid.conf (or any editable file in the program files path for that matter) raises a permissions error when trying to save (due to program files privileged path protection), forcing you to save it elsewhere, then you have to navigate to that folder and manually move it, overwriting the existing file....its a long way to do things if you need to edit squid.conf (or any other editable file under program files) regularly, mostly during testing. Under a path of c:\squid, theres no such penalty, a save actually saves in one easy click :)

I always install to the root of the drive, but others may not even think about this when installing. Being a ported linux program, its already got enough path quirks, program files doesnt need to be mixed in :)

Cheers and thanks for the squid build!

Is it possible to use transparent Squid on Windows?

"... currently use Windows 64bit 8.1 with 2 NIC, 1 with free internet access and other releasing access to LAN, squid 2.7.STABLE8. To redirect all traffic from port 80 to the squid, I'm using (SoftPerfect Bandwidth Manager 3.0.9 Full). My squid is in transparent mode (squid.conf with the line "http_port 3128 transparent") ..."

Need to check if this can be done with 3.5 build.

Change scope of firewall rule or add a message to the installer

Thanks go to Dennis for proposing this improvement:

"Default squid.conf does not work in the default VMs provisioned in Rackspace and EC2. ... the reason is that you are configuring the Windows Firewall inbound rule for "scope=Local subnet", and for some reason this does not resolve to the out-of-the-box private networks created by EC2 or Rackspace. ... After replacing this scope with an IP subnet mask like 10.0.0.0/8 everything starts working."

TODO: add a message to the installer to check this setting if Squid has empty access.log and remote proxy connections are timing out,
or add the above range as a scope

Requried DLL is missing for ssl_crtd.exe

The program can't start because cygcrypto-1.0.0.dll is missing from your computer. Try reinstalling the program to fix this problem.

The ssl_crtd.exe is needed for correct HTTPS filtering

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.