Skip to content

Instantly share code, notes, and snippets.

@yvanin
Last active December 11, 2024 10:00
Show Gist options
  • Select an option

  • Save yvanin/ef831720112c1f6ee8c3 to your computer and use it in GitHub Desktop.

Select an option

Save yvanin/ef831720112c1f6ee8c3 to your computer and use it in GitHub Desktop.
HTTP proxy with basic authentication using Squid
  1. Download and install Squid 3.5 for Windows (default path is C:\Squid)

  2. Create file C:\Squid\etc\.htpasswd with the following content:

    admin:$apr1$kWA/DRFy$klaeXRe3S3jIPqc64HTMA0

    This corresponds to username admin and password 1234
    To generate your own username/password use http://www.htaccesstools.com/htpasswd-generator-windows/

  3. Open Squid configuration (squid.conf)

  4. Add following to the top of squid.conf:

    auth_param basic program "/cygdrive/c/squid/lib/squid/basic_ncsa_auth.exe" "/cygdrive/c/squid/etc/.htpasswd"
    acl ncsa_users proxy_auth REQUIRED
    http_access allow ncsa_users

  5. Comment out all http_access allow ... entries in squid.conf (except ncsa_users)

  6. Restart Squid service

Web proxy is ready!

Proxy address: http://127.0.0.1:3128/
Proxy username: admin
Proxy password: 1234

@sadminnp

sadminnp commented May 7, 2022

Copy link
Copy Markdown

it doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment