Skip to content

itsjfx/go-http-proxy-to-socks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-http-proxy-to-socks

Something quick I wrote to solve an issue I had, and to learn net Dialers and http Handlers in Go.

  • I didn't implement the full RFC. If you want something proper, use 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, 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

About

quick and dirty hpts server in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages