kost/revsocks — reverse-engineered prompt
Reverse engineered prompt
Build me a single file Go command line tool called revsocks that lets me create a reverse SOCKS5 tunnel. I want to run a server on a VPS that listens for an incoming connection and exposes a local SOCKS5 port, then run a client on another machine that connects back to it so I can use the VPS side as a SOCKS proxy.
Make it work on Linux, Windows, Mac, and BSD, with TLS on by default and automatic certificate generation if I do not provide cert files. I also want an option to turn TLS off, a websocket mode, and a DNS tunneling mode for SOCKS over DNS. Please support connecting through an upstream proxy too, including no auth, basic auth, and NTLM auth, plus a custom user agent and proxy timeout.
Add a shared password between client and server, reconnect attempts and delay settings, environment variable support for flags, and quiet and debug modes. Keep it as one executable with clear command line help and example usage. Look up current docs online if you need to.
Want more depth? Deep Reverse