logo
January 11, 2023

[TIL] Setup tinyproxy on Centos Linux

TIL how to build a proxy on Linux

One of the best ways to be secure while browsing the Internet is by using proxy servers. The proxy server is an important thing to know about nowadays.

What's a proxy server?

A proxy, in the English definition, is the "authority or power to act for another." A proxy server, in the computing context, is a server that acts on behalf of another server, or a user's machine.

By using a proxy to browse the Internet all of the user's Internet traffic appears to come from the proxy server instead of their machine. To set up a free high-speed proxy server all you need is a free tier AWS account.

Create your own proxy server

We will use TinyProxy to setup our server as the Proxy. Tinyproxy: https://tinyproxy.github.io/

Tinyproxy is a light-weight HTTP/HTTPS proxy daemon for POSIX operating systems. Designed from the ground up to be fast and yet small, it is an ideal solution for use cases such as embedded deployments where a full featured HTTP proxy is required, but the system resources for a larger proxy are unavailable.

We can install TinyProxy via yum command like this article Install Tinyproxy on Centos 7 . However, the TinyProxy version is 1.8.5, it is quite old. I want to use the authentication function BasicAuth so will install from the source code.

Get latest TinyProxy version

Get latest TinyProxy version from Releases page. I use the latest version 1.11.0

c
Install all dependencies

It requires some Linux packages for compile the TinyProxy from source code.

c
Build TinyProxy

In TinyProxy directory we build the binary files

c

Install the binary. The binary file will be installed to /usr/local/bin/tinyproxy so we need sudo

c

Check version

c
Update TinyProxy configuration

The quickest way to get started is using a minimal config file like the below:

Update the configuration file /etc/tinyproxy/tinyproxy.conf

c
c

Please check the document here for more detail configuration.

Create service for TinyProxy

We create a system service to keep TinyProxy running more stable.

Create the file named by /etc/systemd/system/tinyproxy.service

sudo vim /etc/systemd/system/tinyproxy.service

c
Run TinyProxy service

Enable tinyproxy service from OS start

c

Start the service

c

Check the service status

c

The output should be like

c
Test your own proxy

From your machine test the proxy by checking your machine IP

c

Tada 🍻 Happy Proxy 🍻

Thank your for reading!

References
  • https://gist.github.com/kooroshh/2084ed52e81bcf6d60c5b0aa37524ed0
  • https://dev.to/viralsangani/be-anonymous-create-your-own-proxy-server-with-aws-ec2-2k63