I have 2 local applications which communicate over TCP/IP using hard-coded (fixed) port. This works ok when there is only 1 user on a workstation. However, the second user of the workstation can't use the applications because the port is occupied by the applications of the first user.

If it's possible, then how to set per-user policy to forward the port for just these 2 applications? Something like a rule "if application A binds to localhost port N then bind it to localhost port N+1" and "if application B connects to localhost port N then connect it to localhost port N+1".

Administrative or programmatic solution is ok. The OS is Windows Server 2012 R2.

  • Is it about port forwarding, like on a router? You used the phrases "bind it to localhost", "connects to localhost", so maybe it's purely local communication? I'm somewhat confused. If local: can you choose the IP the application binds to? E.g. A would bind to on the fixed port; B would bind to on the same port. – Kamil Maciorowski Jul 4 '17 at 15:35
  • It's purely local communication. I can't choose the IP the application binds to. I believe it binds to I say "port forwarding" because it's an analogy that comes to my mind: like on a router/firewall, but local within a machine. – Serge Rogatch Jul 4 '17 at 15:39
  • So you'd like to make the application "think" it binds to the hard-coded port, while in fact it binds to another port? – Kamil Maciorowski Jul 4 '17 at 15:51
  • @KamilMaciorowski, yes, and I would like the corresponding for the connecting application too. – Serge Rogatch Jul 4 '17 at 15:54
  • 1
    Might be easier to look into something like VM's or Docker to provide seperate namespaces. – mtak Jul 4 '17 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.