Private Relay is a privacy-preserving TCP proxy—essentially HAProxy in mode tcp—that facilitates IP anonymization when routing multiple clients traffic through it.
See the GitHub repository for more context →
As a quick example of the functionality, relay.privaterelay.technology runs this image with the default config:
curl -sSL 'https://httpbin.org/ip' | jq '.origin'
# => $ADDRESS1
curl -sSL --connect-to httpbin.org:443:relay.privaterelay.technology:443 'https://httpbin.org/ip' | jq '.origin'
# => $ADDRESS2Note that $ADDRESS1 ≠ $ADDRESS2. 🥳
This image is the base haproxy image with a custom config—please see the upstream documentation as well.
1️⃣ Create a backends.yaml file with a set of backend servers:
backends:
- name: httpbin
host: httpbin.org
port: 4432️⃣ Use this as a base image, COPY backends.yaml /app/, running templatefile to generate the config:
FROM privaterelay/privaterelay
RUN templatefile /app/haproxy.cfg.tmpl /app/backends.yaml > /usr/local/etc/haproxy/haproxy.cfg3️⃣ Start your container:
docker run --rm --detach --publish 8080:443 --name private-relay private-relayHAProxy is now running on the host's :8080.