Building a Multi-Protocol Proxy Server in Go

Building a Multi-Protocol Proxy Server in Go

@Kripul_
@Kripul_ Feb 11, 2026 • 3 min read

I run a VPS with a generous IPv6 /64 subnet (thousands of unique addresses available), and I needed a proxy server where each user gets their own distinct exit IP. Multi-account automation, or avoiding IP-based rate limits—every connection from a different user should appear to come from a completely unique IPv6 address on the target sites.

Most existing open-source proxies don’t make this easy: they either lack per-user binding, require separate instances/ports, or don’t handle IPv6 binding cleanly. So I built goproxy from scratch in Go to solve exactly this problem.

Repo: https://github.com/kripul/goproxy

Why I Built This (The Real Motivation)

Many cheap VPS providers now include large IPv6 subnets (/64 or bigger), giving you practically unlimited unique public IPv6 addresses on one server. The dream use case: assign each proxy user their own exit IP so they don’t share the same address (which can lead to bans, rate limits, or detection in scraping, sneaker bots, social media management, etc.).

But off-the-shelf proxies fall short:

  • They usually exit from the server’s primary IP only.
  • Per-user customization is rare or complicated.
  • IPv6 binding per connection/user isn’t straightforward.

I wanted a single, efficient proxy instance that:

  • Listens on one port.
  • Supports both HTTP and SOCKS5.
  • Automatically binds outgoing traffic to a user-specific IPv6 address.

That’s why goproxy exists.

Key Features of goproxy

  • Single Port, Multi-Protocol
    One listening port (default: 1080) handles both HTTP proxy (including CONNECT for HTTPS) and SOCKS5 (CONNECT + UDP ASSOCIATE).
    Protocol auto-detection from the first byte (0x05 = SOCKS5, else = HTTP)—no client config changes needed.

  • Per-User Exit IP (Core Featu"re!)
    Assign each user their own external_ip in users.json.
    Outgoing TCP/UDP connections are bound to that IPv6 address → targets see the user’s dedicated IP.

    Example users.json:

    {
      "user1": {
        "password": "pass123",
        "external_ip": "2001:db8:abcd:1234::cafe"
      },
      "user2": {
        "password": "xyz789",
        "external_ip": "2001:db8:abcd:1234::babe"
      }
    }
    
  • Flexible Authentication
    Static or file-based (users.json with per-user external_ip).

  • Access Control List (ACL)
    CIDR-based whitelist/blacklist for client IPs (IPv4 & IPv6).

  • Traffic Control
    Per-second connection limits + per-connection bandwidth shaping.

  • Full Dual-Stack IPv4 + IPv6
    Listens on :: (all interfaces), native IPv6 outgoing binding.

  • Structured Logging & Hybrid Config
    JSON + env vars (env overrides for easy Docker/systemd use).

Easy Installation & Running

  1. Go 1.21+ required.
  2. Clone & build:
    git clone https://github.com/kripul/goproxy.git
    cd goproxy
    go build -o proxy-server ./cmd/server
    
  3. Configure:
    cp config.json.example config.json
    cp users.json.example users.json
    
    Add your IPv6 addresses to users.json.
  4. Run:
    ./proxy-server
    
    Or use systemd for production (example unit file in repo).

Quick Testing

Check exit IP per user:

curl --proxy-user user1:pass123 -x socks5h://your-vps-ip:1080 http://ipinfo.io/ip

It should return the exact IPv6 assigned to user1!

Why Go?

Static binaries, high performance (buffer pooling + golang.org/x/time/rate), modular code, and excellent native IPv6 handling in the net package.

It’s early (v0.1.x), but stable and “Ya, it’s working” on my VPS.

Get Involved

MIT-licensed: github.com/kripul/goproxy
Star/fork if useful! PRs welcome for features like IP rotation from /64, metrics, or Docker support.

© 2026 Nixpoin.com. Built with performance in mind.