Giter Site home page Giter Site logo

squid-proxy's Introduction

squid-proxy

This is an automatic script to install Squid-proxy with basic authentication for Linux Ubuntu. This script is already tested and working in Linux Ubuntu 16.04 LTS & 18.04 LTS.

Installation

  1. Download or clone this repo.

    git clone https://github.com/dnwandana/squid-proxy.git
    cd squid-proxy
  2. Make the file install-squid.sh is executable.

    sudo chmod +x install-squid.sh
  3. Execute install-squid.sh

    sudo ./install-squid.sh

Installation note

  • You'll be prompted for first user to use the proxy-server. You can leave it blank (add user later).

  • To add another user you can type :

    sudo htpasswd /etc/squid/passwd username

    ^ Change username to your preferred username.

Verify the Squid service status

  • To verify if the squid service is running, you can type :

    sudo systemctl status squid

    You should see the active (running) status like this.

    Loaded: .....
    Active: active (running) since DATE; TIME ago
    Docs: ....
  • or you can check running Squid proxy port using following command :

    sudo netstat -ntlp

    By default, Squid runs on port 3128. You should see the result like this.

    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp6       0      0 :::3128                 :::*                    LISTEN      14768/(squid-1)

Test Squid proxy

We're gonna test Squid proxy authentication using curl. You can use the following syntax :

curl -x [SQUID_SERVER_IP]:[SQUID_PORT] --proxy-user [USERNAME]:[USER_PASSWORD] -I [SITE]

For Example :

curl -x 192.168.0.100:3128 --proxy-user testuser:P@ssw0rd -I https://google.com/

You'll see the following results :

  • Success

    HTTP/1.1 200 Connection established
  • Authentication Error

    HTTP/1.1 407 Proxy Authentication Required
    .....
    .....
    Received HTTP code 407 from proxy after CONNECT

    That's it now you're ready to go to use Squid proxy for any reason!

Reference

squid-proxy's People

Contributors

dnwandana avatar

Stargazers

 avatar

Watchers

 avatar

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.