How do I direct SOCKS5 proxy traffic to other SOCKS5 proxies based on ports?

Linode Staff

If you can help point me in the right direction, it would be appreciated.

So I bought a bunch of premade SOCKS5 proxies from a provider, and I want to set up a single Linode VPS as a SOCKS5 proxy that can point to other proxies depending on the port.

This is my Linode server's IP address:

I want socks5 connections to particular ports to be redirected to the socks5 proxies I bought.

For example, this way (randomly generated IP addresses for forwarded destination): -> -> -> -> -> and so on.

So for example, if I went on Proxifier on Windows:

if I connect to, i'd get on

if I connect to, i'd get on

The point of this is to make proxy management easier for my use case.
I have a lot of proxies that I need to replace in a tedious GUI on a Windows software.
It gets hard to manage, so my end goal is to have a setup like this,
in a way that I can have a simple text file in the format:> proxy1:port> proxy2:port> proxy3:port, etc.

This way, I'd set up that static ip on the GUI software, only once and don't touch it again. I want to have a central proxy list text file to deal with this in one place. To do any replacements, I'd go edit my text file. etc.

Eventually I could make it be a web database, but that's finishing touches. Ideally, replacing any proxy in this file would not make other connections be disconnected.

So I assume I'll have to write a program for this part, to keep each connection isolated from each other, unless there's something already made.

It seems like a very simple concept though, I would be surprised if nothing already exists in open source for this.

I see proxy companies sell "backconnect" SOCKS5 proxies, which is this exact same setup. 
But no results on how they accomplish this, and the fact that I need SOCKS5 makes it harder to find relevant results.

Also, the proxies I buy are premade, so you can only access them as SOCKS5 proxy.
They don't allow SSH access so I can't go into each server and install additional software.

Please, let me know if you happen to know any information on this/what tools to research.

Thank you

1 Reply

Linode Staff

Admittedly, I’m not very familiar with SOCKS5, so I apologize if the information that follows doesn’t fully encompass what your goal is.

It seems like you want to create a SOCKS5 proxy chain, but you want to make it dependent on the ports that are accessed. While I wasn’t able to find any resources that would directly apply, I saw that you mentioned using Proxifier on Windows to achieve something similar. I was able to gather a few resources that were indicated as Linux-based alternatives to Proxifier:

I also found other resources that may help you in your endeavors:

Please use these tools/resources at your own discretion as I didn’t personally test them myself.

My colleague also mentioned an alternative just in case you wanted to ditch SOCKS5, which you’re probably pretty set on doing, but I’ll throw it in here anyway. NGINX reverse proxy will forward the request to the IP and then the IP will forward back the data to the user through the proxy, keeping the backend server’s true IP hidden. For more information on NGINX reverse proxy, please refer to NGINX official documentation:

We also have a guide on configuring NXGINX reverse proxy:

Best of luck!


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct