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.
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.
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 from Releases page. I use the latest version 1.11.0
cwget https://github.com/tinyproxy/tinyproxy/releases/download/1.11.0/tinyproxy-1.11.0.tar.bz2tar -jxvf tinyproxy-1.11.0.tar.bz2cd tinyproxy-1.11.0/
It requires some Linux packages for compile the TinyProxy from source code.
csudo yum update -y \&& sudo yum install make g++ gcc autogen automake autoconf asciidoc cmake git vim -y \&& sudo yum groupinstall 'Development Tools' -y
In TinyProxy directory we build the binary files
ccd tinyproxy-1.11.0/./autogen.sh./configuremake
Install the binary. The binary file will be installed to /usr/local/bin/tinyproxy so we need sudo
csudo make install
Check version
c/usr/local/bin/tinyproxy -v
The quickest way to get started is using a minimal config file like the below:
Update the configuration file /etc/tinyproxy/tinyproxy.conf
csudo vim /etc/tinyproxy/tinyproxy.conf
cUser rootGroup rootPort 8888Timeout 600DefaultErrorFile "/usr/share/tinyproxy/default.html"Logfile "/var/log/tinyproxy.log"LogLevel InfoPidFile "/var/run/tinyproxy.pid"MaxRequestsPerChild 0BasicAuth your_user your_password
Please check the document here for more detail configuration.
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[Unit]Description=TinyProxy ServiceRequires=network.targetAfter=network.target[Service]Type=forkingPIDFile=/var/run/tinyproxy.pidExecStart=/usr/local/bin/tinyproxy -c /etc/tinyproxy/tinyproxy.confRestart=on-failure[Install]WantedBy=multi-user.target
Enable tinyproxy service from OS start
csudo systemctl enable tinyproxy
Start the service
csudo service tinyproxy restart
Check the service status
csudo service tinyproxy status
The output should be like
c$ sudo service tinyproxy statusRedirecting to /bin/systemctl status tinyproxy.service● tinyproxy.service - TinyProxy ServiceLoaded: loaded (/etc/systemd/system/tinyproxy.service; disabled; vendor preset: disabled)Active: active (running) since Tue 2023-01-10 14:52:30 UTC; 2s agoProcess: 20361 ExecStart=/usr/local/bin/tinyproxy -c /etc/tinyproxy/tinyproxy.conf (code=exited, status=0/SUCCESS)Main PID: 20363 (tinyproxy)CGroup: /system.slice/tinyproxy.service└─20363 /usr/local/bin/tinyproxy -c /etc/tinyproxy/tinyproxy.confJan 10 14:52:30 systemd[1]: Starting TinyProxy Service...
From your machine test the proxy by checking your machine IP
c# from proxy server
Tada 🍻 Happy Proxy 🍻
Thank your for reading!
Table of Contents
- if you want to change the world, start by making your bed every morning
Compressing PDFs with a Simple CLI Command
A neat way to do it using Ghostscript, a powerful command-line tool to compress a PDF