简体   繁体   中英

How to rewrite the TCP destination port during the TCP connection on Windows?

I have a client which is intended to connect to a server. For the client, the remote TCP port number is fixed(ie 102). I can NOT change it(while I can change the remote IP address). However, the TCP Port number the server is listening on is fixed as well(ie 1024) and I can NOT change it too. These two port numbers are different. I want to make the client connect to the server smoothly.

At the first, I had a idea that I setup a proxy listening on localhost:102 and the client connect to 127.0.0.1:102. Then this proxy redirect these TCP traffic to the real address RemoteServerIP:1024. But I found on my windows, there was already a process which is listening on 0.0.0.0:102 and I can NOT change its listening port. So this idea can NOT work.

Thank you very much.

如果您不能在运行客户端的同一Windows计算机上执行此操作,为什么不尝试在另一台(可能是Linux)计算机上执行此操作?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM