My ($host, $port) = $server = IO::Socket::INET->new( ) || die "Unable to connect to $host:$port: $!" My ($host, $port) = IO::Socket::INET->new( It's called and it uses IO::Socket::INET to abstract sockets, and IO::Select to do connection multiplexing. If you don't have root privileges, and you don't want to leave your proxy open (and you really don't want to do that), you'll have to use some kind of a simple TCP proxy wrapper to do access control. However, executing iptables requires root privileges. The first rule says, allow anyone from 1.2.3.4 to connect to port 1080, and the other rule says, deny everyone else from connecting to port 1080. Iptables -A INPUT -p tcp -dport 1080 -j REJECT Iptables -A INPUT -src 1.2.3.4 -p tcp -dport 1080 -j ACCEPT For example, to allow only people from the ip 1.2.3.4 to use SOCKS5 proxy, add the following iptables rules:
How to make a socks5 proxy list software#
To use it, just make your software use SOCKS5 proxy on your Linux computer's IP, port 1080, and you're done – all your requests will now get proxied.Īccess control can be implemented via iptables. If you also want the command to go into background as a daemon, then add the -f option: ssh -f -N -D 0.0.0.0:1080 localhost The -N option makes sure ssh stays idle and doesn't execute any commands on localhost. The ssh command starts up dynamic -D port forwarding on port 1080 and talks to the clients via SOCSK5 or SOCKS4 protocols, just like a regular SOCKS5 proxy would. ssh -N -D 0.0.0.0:1080 localhostĮven better – it doesn't require root privileges. This article will be interesting to everyone who didn't know this awesome fact already – you can turn any Linux computer into a SOCKS5 (and SOCKS4) proxy with just one ssh command command and no extra tools. I can then just edit them together and produce the final article. It goes hand in hand with my upcoming article series on 100% technical guide to anonymity and it's much easier to write larger articles by splitting them into smaller pieces. I thought I'd write a shorter article this time.