Linux serverlinux web serverNETWORK ADMINISTRATIONS

How to Create a Proxy // Squid (HTTP) and SOCKS

Try out ScraperAPI and program your own proxy!
https://bit.ly/3CJvD9J (Affiliate Link)

Follow me on a Twitter and Facebook!

https://www.facebook.com/Dev0dyssey

Welcome back to Dev Odyssey Home Networking! In this episode I visually explain how HTTP and Socket Secure (SOCKS5) proxies work.

In this video, I show you how to set up an HTTP and SOCKS5 proxies using Squid and Ubuntu 20.04 LTS with OpenSSH. Then we test out these proxies using Postman and FoxyProxy plugin for Firefox. Proxies have many benefits, some of which are increased anonymity browsing online, enabling access to different online content, a means to analyze web traffic, parental blocks on website, and much more. Once you know how to create and connect to proxies, your benefits are limited to your imagination.

Video Outline

00:00 Intro
00:26 What are Proxies
00:53 HTTP Proxy Explained
02:35 SOCKS Proxy Explained
03:56 Proxy Benefits Recap
04:20 Preliminary Test
05:07 Download / Configure Squid Proxy
06:33 Configure / Test Proxy In Postman
07:31 Squid Access.log
07:51 Adding Basic Auth to Squid Proxy
10:44 Configure / Test Proxy Auth in Postman
11:35 Configure SOCKS Proxy
12:02 Showing Open Ports
12:28 Configure SOCKS Proxy in FoxyProxy
13:21 Testing SOCKS Proxy
13:36 Outro

A Proxy server is simply an intermediary, or middle man, that processes requests for you on their way out to their destination, acting as a client itself on your behalf. There are many different proxy services and protocols, but in this case, we will be discussing the most popular, HTTP(s) and SOCKS (Socket Secure) proxies.

HTTP Proxy Diagram
SOCKS Proxy Diagram

Benefits – Similar to intro items

Increased Anonymity Browsing Online
Enable access to different content
Analyze web traffic
Parental Blocks on Websites

Demonstration

Squid Proxy
1. Install squid (sudo apt install squid)
2. Make copy of squid.conf (sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.default)
3. Edit squid.conf (sudo vim /etc/squid/squid.conf), uncomment http_access allow localnet, save file
4. Restart Squid (sudo systemctl restart squid)
5. Check if its running (sudo systemctl status squid) Should see “running” and “active”
6. Configure Proxy in Postman and test (Settings, then Proxy tab). Add IP of Proxy Server, then default port (3128)
7. Check Access log for entries (sudo vim /var/log/squid/access.log)
8. Add basic user / password for authentication
1. Add the following
1. auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/htpasswd
2. auth_param basic realm Squid Proxy Caching Web Server
3. acl authenticated proxy_auth REQUIRED
4. acl authenticated_ips src {{CLIENT_IP_ADDRESS}}/32
5. http_access allow authenticated authenticated_ips

1. Run the following replacing “username” and “password” accordingly: sudo printf “USERNAME:$(openssl passwd -crypt PASSWORD)n” | sudo tee -a /etc/squid/htpasswd
2. Restart Squid
3. Configure Postman to use Proxy Auth (Settings then Proxy). Fill in Username and Password

SOCKS Proxy
1. Login to Ubuntu Server using SSH, with -D flag for dynamic port forwarding
* Dynamic Port Forwarding. – Creates a SOCKS proxy server that allows communication across a range of ports.
2. Configure Foxy Proxy By Adding a new Proxy, then changing the type to “SOCKS5”, IP Address as your localhost (127[.]0[.]0[.]1), and port you used (40932)
3. Save Configuration with name Test SOCKS. Open new tab in Firefox, set FoxyProxy to use Test SOCKS

Other Dev Odyssey Network Videos:

How to Create a VLAN – A Beginner’s Guide // OpenWrt – https://youtu.be/5TtlAXeaGUM

What is Port Forwarding? – https://youtu.be/3RfLn2jcGjA

How to Connect 2 Routers on the Same WiFi Network – https://youtu.be/WyUlzFO90KA

What is a WAN Port On A Router? – https://youtu.be/WyUlzFO90KA

Home Networking Playlist

Network Security Playlist

Icon Attribution
Icons made by Freepik from Flaticon
www.flaticon.com

Icons made by Vectors Market from Flaticon
https://www.flaticon.com/authors/vectors-market

Icons made by Smashicons from Flaticon
https://www.flaticon.com/authors/smashicons

Ubuntu is a trademark of Canonical

Squid Artwork
Creative Commons — Attribution-ShareAlike 3.0 Unported — CC BY-NC-SA 3.0

Music Attribution
Sunrise by SKIRK https://soundcloud.com/skirkofficial
Creative Commons — Attribution-ShareAlike 3.0 Unported — CC BY-SA 3.0
Free Download / Stream: https://bit.ly/2Sg2SNU
Music promoted by Audio Library https://youtu.be/Jrx5sHKQBj4

source

by Dev Odyssey

linux web server

21 thoughts on “How to Create a Proxy // Squid (HTTP) and SOCKS

  • What do you use proxies for? Curious to learn all what Squid (HTTP) Proxy or SOCKS can do?

  • Before you changed localnet to authenticated […] could you have still used that as a proxy server, but that it just would allow anyone to connect to it? And replacing that iwth the authenticated […] makes it restricted to only the ip address you want?

  • Thanks I'm using Hidemyacc with the proxies you shared and it work seamlessly. Legit 👍

  • Unfortunate that it focused on adding authentication to a proxy instead of actually show useful configurations, such as stripping headers, blocking some destination URLs, etc.

  • Bro what are you talking about. Ssh has no necessary relationship with a SOCKS proxy at all. SOCKS is just a protocol for handling and forwarding general tcp/udp traffic.

    Why make a video if you don't even understand it yourself?

    EDIT: lol I see why you're confused. Cos you're using SSH SOCKS5 proxy support, but that's just a feature of ssh, not all SOCKS5 proxies work via ssh, that's just openssh implementation. There's many other ones, such as shadowsocks, and many more

  • SOCKS is the protocol, OpenSSH just provides a SOCKS server implementation. Just like squid is an HTTP proxy

  • wait so is a SOCKS proxy just a more safer version of the https

  • Do you know an easy proxy to set up for mobile

  • If you are using Openssl 3 in any distribution of linux -crypt command whas removed instead to generate the encrypted password you could use :
    sudo sh -c 'printf "usuario:$(openssl passwd -6 -salt $(openssl rand -hex 16))n" >> /etc/squid/htpasswd'
    replace 'usuario' with the username

  • How do install the socks proxy, and where would I go to install it?

  • Thanks for informative video, can I assign to the squid proxy server public IP ,so it will be accessible by other devices on the internet?

  • can you make this process using a 4g Modem to get 4g Ip ?

  • I don't clearly understand should I install Squid in case SOCKS proxy? Or I just configure sshd on the remote server and create a ssh connection with -D option to it, after that configure my local listen port to the web browser

  • Is it possible to create your own random public i.p addresses using this method? Or do you still need to use the i.p address you get from your isp?

  • thx the FBI has stupid stuff hidden from me ( for no reason but to piss me off ) all i gotta do is set up a proxy and change the MAC address of my dads laptop my searches should be back to normal

  • Hello sir I'm confused at ip where can I get ip were you enter on postman and first of the video in terminal like " ssh squid@ip "
    So where can I find this ip can u tell me pls

    Edit : and when i type ifcongif command on terminal i found "wlan0 and there is ip showing that ip i entered in postman and then i follow ur next "http/ifconfig" so i found ip but is different and ur too different and 3rd step u type in terminal " sudo vim var/log and then i found same IP were i entered in postman but ur ip is different and so also it's work for me ? And where i found my ip last digit like "109.09.09.0/this number

Comments are closed.