OPNsense Forum

Archive => 18.1 Legacy Series => Topic started by: comet on March 26, 2018, 10:31:58 pm

Title: Plugin suggestion: Persistent SOCKS5 proxy
Post by: comet on March 26, 2018, 10:31:58 pm
Don't know if this is the correct forum for this but anyway if anyone is looking for the chance to author a plugin, here's my suggestion: A persistent SOCKS5 proxy that could be used by any device on the local network.  This assumes you can SSH into some other system to create the proxy.  My guess would be that beneath the GUI you'd use something like autossh to set up the proxy, since if the connection drops autossh will keep trying to reconnect.

The plugin would need to ask for the following information (at a minimum) to make the ssh connection:

SSH IP address
SSH Port (default: 22)
SSH Username
SSH Password  (could also allow the use of Public Key authorization, I'm not sure what would be required to enable that)
SOCKS5 Proxy Port

I believe this would translate to something like this:

autossh -f -N -C -p SSHport Username@IPaddress -D SOCKS5ProxyPort

-f runs it in the background
-N tells ssh to not run any commands
-C disables compression
-p SSHport is not needed for default SSH port 22 (some people run SSH on an alternate port for security reasons)

Once this is set up, the idea is that any machine or software on the local network (Firefox, for example) could use the SOCKS5 proxy simply by specifying the router's address and the SOCKS5 Proxy Port number.  You would not have to run multiple SOCKS5 proxies from each local machine on the network that needs to use the proxy.

Just a suggestion and just so you know, I am not a programmer and would not have even the beginnings of a clue how to do this myself.  If you like the idea you are welcome to it; if you don't then feel free to ignore it.