https://github.com/app-fast/fpgo
Fasthttp forward proxy
https://github.com/app-fast/fpgo
fasthttp forward-proxy forwarding-proxy http-proxy https-proxy proxy tunneling websocket-proxy
Last synced: 3 months ago
JSON representation
Fasthttp forward proxy
- Host: GitHub
- URL: https://github.com/app-fast/fpgo
- Owner: app-fast
- Created: 2023-03-17T14:47:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-12-27T03:15:49.000Z (3 months ago)
- Last Synced: 2025-12-27T04:54:34.660Z (3 months ago)
- Topics: fasthttp, forward-proxy, forwarding-proxy, http-proxy, https-proxy, proxy, tunneling, websocket-proxy
- Language: Go
- Homepage:
- Size: 63.5 KB
- Stars: 21
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
## Fasthttp forward proxy
### â
Features
- [Fasthttp](https://github.com/valyala/fasthttp)
- http/https proxy
- ws/wss proxy
- IPv4/IPv6 supported (See [#2](https://github.com/app-fast/fpgo/pull/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
```fish
./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
```fish
./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
```fish
./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](https://github.com/app-fast/fpgo/issues/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
- Original net/http implementation - https://www.sobyte.net/post/2021-09/https-proxy-in-golang-in-less-than-100-lines-of-code/
- Inspired by [goproxy](https://github.com/snail007/goproxy) - Closed-source (only very few lines of code are open-source) multi-purpose proxy. TBH this one seems to be unstable in heavy traffic that's why I made fpgo đđ
- Inspired by [hcproxy](https://github.com/romkatv/hcproxy) - Linux-only lightweight proxy
- Inspired by [dumbproxy](https://github.com/SenseUnit/dumbproxy) - This one is great for everything except it doesn't handle ws/wss properly
### đĒĒ Licence
Public domain