https://github.com/itsjfx/go-http-proxy-to-socks
quick and dirty hpts server in Go
https://github.com/itsjfx/go-http-proxy-to-socks
Last synced: 6 months ago
JSON representation
quick and dirty hpts server in Go
- Host: GitHub
- URL: https://github.com/itsjfx/go-http-proxy-to-socks
- Owner: itsjfx
- License: gpl-3.0
- Created: 2025-01-04T14:21:41.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-01-05T04:34:52.000Z (12 months ago)
- Last Synced: 2025-06-29T00:57:59.490Z (6 months ago)
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-http-proxy-to-socks
Something quick I wrote to solve an issue I had, and to learn [net Dialers](https://pkg.go.dev/net#Dial) and [http Handlers](https://pkg.go.dev/net/http#Handler) in Go.
* I didn't implement the full RFC. If you want something proper, use [tinyproxy](https://github.com/tinyproxy/tinyproxy)
* I'd not use this in a production environment
* I've used this briefly a handful of times and not faced any issues
Use case:
* `ssh -D` ("dynamic" forwarding) exposes a SOCKS server, but some applications only support HTTP proxies
* Sometimes my main workaround, [proxychains](https://github.com/rofl0r/proxychains-ng), does not work (e.g. if the binary is statically linked)
* A HTTP proxy that forwards to the SOCKS server is a simple workaround
* Go has amazing static cross-compilation support, so I can build and run this for an ARM64 system very easily
## Usage
```
Usage of ./hpts:
-http-port string
HTTP proxy server port (default: 8080) (default "8080")
-listen-ip string
IP address to listen on (default: 0.0.0.0) (default "0.0.0.0")
-socks-hostname string
SOCKS5 server hostname or IP (default: localhost) (default "localhost")
-socks-password string
SOCKS5 password (optional)
-socks-port string
SOCKS5 server port (default: 1080) (default "1080")
-socks-username string
SOCKS5 username (optional)
```
## See also
* [oyyd/http-proxy-to-socks](https://github.com/oyyd/http-proxy-to-socks)
* [chux0519/hpts](https://github.com/chux0519/hpts)