Home
Softono
fpgo

fpgo

Open source Go
23
Stars
3
Forks
0
Issues
1
Watchers
3 months
Last Commit

About fpgo

Fasthttp forward proxy

Platforms

Web Self-hosted

Languages

Go

Links

Fasthttp forward proxy

βœ… Features

  • Fasthttp
  • http/https proxy
  • ws/wss proxy
  • IPv4/IPv6 supported (See #2)
  • Multi DNS nameserves (-n "1.1.1.1,8.8.8.8")
  • Graceful shutdown
  • Proxy Chain (-x "second.proxy.addr:8080")
  • Battle-Tested and Production-Ready

πŸ“™ Usage

./fpgo -h # Show usage

Usage of ./fpgo:
  -a string
        Listen address. (default ":13002")
  -c int
        Max concurrency for fasthttp server (default 128)
  -h    Show usage
  -l int
        Log level. Examples: 0 (debug), 1 (info), 2 (warn), 3 (error). (default 1)
  -n string
        DNS nameserves, E.g. "8.8.8.8" or "1.1.1.1,8.8.8.8". Default is empty (OS default)
  -t duration
        Connection timeout. Examples: 1m or 10s (default 1m0s)
  -v    Show version
  -x string
        Set up a proxy chain. E.g. "localhost:12345"

πŸ’‘ Basic Example

./fpgo -a "0.0.0.0:13002" -c 1000 -n "8.8.8.8,1.1.1.1" -t 30s
curl -x http://localhost:13002 http(s)://example.com

πŸ’‘ Proxy Chain Example

./fpgo -a "0.0.0.0:13001"  # Proxy 1
./fpgo -a "0.0.0.0:13002" -x "localhost:13001" # Proxy 2
./fpgo -a "0.0.0.0:13003" -x "localhost:13002" # Proxy 3
curl -x http://localhost:13003 http(s)://example.com

πŸ’‘ Websocket Example

./fpgo -a "0.0.0.0:13002"
wscat --proxy http://localhost:13002 -c wss://websocket-echo.com

πŸ“Œ Caveats

This proxy server was used as a cheap knock-off of NAT Gateways on low-end hardwares originally, and was tuned for maximum performance, flexibility and less dependencies in our environments. But we've seen more and more people use it in production, so it's our responsibility to make sure everyone knows the following:

  • This is not a reverse proxy. The difference is that a forward proxy protects clients while a reverse proxy protects servers.
  • Unlike other forward proxies like Squid, responses or files are not cached.
  • Unlike other forward proxies, fpgo doesn't support user:password authentication, so beware of hackers taking over and use it as a jump server.
  • HTTPS prevents a forward proxy recording network traffics, see #1 .
  • A socks5 proxy is probably faster than a http proxy. If fpgo falls short of expectations, take a look at socks5 implementations in go/rust/zig. Nevertheless, not all http clients support socks5 forward proxy.

©️ Credits

πŸͺͺ Licence

Public domain