awl
awl copied to clipboard
Allow to use peers as socks5 proxy server
Sometimes it's necessary to access the internet from another IP address. This can be used to bypass firewalls or government restrictions. This feature allows you to use your known peers to be socks5 proxy server for you (from their permission, of course).
More technically:
- each peer can allow known peer to use themselves as proxy server. This means that there will be new configuration for each peer like
Allow to use my device as socks5 proxy server
. This configuration should be accessible from the GUI and also be in peer status protocol here - somewhere in GUI there should be switch to use one particular peer as socks5 proxy. In system tray it can be a new submenu with list of available peers and a checkbox to use one of them. For interface and cli I don't have any good ideas, probably we can show information about currently used peer in Status section and add button for each peer to set them as proxy
- each peer binds to something like
127.0.0.66:1080
which is intended to be a socks5 proxy endpoint. Something like this. On each connect there should be opened new stream to p2p protocol (below) that should be handled with bidirectionalio.Copy
untilio.EOF
- each peer provides new p2p protocol like this. This protocol handler should first check access (that remote peer can use local peer as socks5 proxy) and then "proxy" incoming stream like this. It probably should be synchronous inside StreamHandler
cc: @GrigoryKrasnochub