Skip to content
vast-cow's blog
Go back

Using Tinyproxy as a Simple Proxy

Edit page

This article focuses strictly on setting up and using Tinyproxy—a lightweight HTTP/HTTPS proxy—on Alpine Linux. The goal is to get a minimal proxy running and understand how to use it from another machine or client.


1. Installing Tinyproxy

On Alpine Linux, installation is straightforward:

apk add tinyproxy

This installs the Tinyproxy service and default configuration files.


2. Basic Configuration

The main configuration file is typically located at:

/etc/tinyproxy/tinyproxy.conf

At minimum, configure the following:

Port 8080
Listen 0.0.0.0

What these settings mean


3. Starting Tinyproxy

You have two operational modes depending on your use case.

Option A — Run in foreground (debug mode)

tinyproxy -d -c /etc/tinyproxy/tinyproxy.conf

Use this when testing or troubleshooting.


Option B — Run as a background service

rc-service tinyproxy start
rc-update add tinyproxy

4. Using Tinyproxy

Once running, Tinyproxy acts as a standard HTTP proxy.

Example: Using it from a client

If your Tinyproxy server is at:

172.27.59.40:8080

You can configure tools to use it as a proxy.

Using curl

curl -x http://172.27.59.40:8080 http://example.com

Using environment variables

export http_proxy="http://172.27.59.40:8080"
export https_proxy="http://172.27.59.40:8080"

Now most CLI tools will route traffic through Tinyproxy.


5. Example: Using Tinyproxy with SSH (via netcat)

Tinyproxy can also proxy TCP connections using the HTTP CONNECT method.

Add this to your SSH config:

Host foomachine
    HostName 1.2.3.4
    ProxyCommand nc -X connect -x 172.27.59.40:8080 %h %p

Explanation

Then connect normally:

ssh foomachine

The connection will be routed through Tinyproxy.


Summary

Tinyproxy provides:

For most use cases, the minimal configuration shown above is sufficient to get a working proxy quickly.


Edit page
Share this post:

Comments


Previous Post
How to Automatically Re-Enable Low Power Mode on iPhone
Next Post
Enabling Persistent Systemd Journal Logging on Linux