How to forward one local port to another?
Asked Answered
O

2

8

I have a HTTP proxy server running on port 127.0.0.1:8888. I need to redirect a HTTP client binding to 127.0.0.1:8080 to be forwarded to 127.0.0.1:8888.

I tried using netsh.exe utility in Windows. I have DHCP client service running in my windows 7.

netsh interface portproxy add v4tov4 listenport=8080 listenaddress=127.0.0.1 connectport=8888 connectaddress=127.0.0.1

The command was successfully executed. However the proxy server never receives any request. Is it not possible to forward local ports? Or my understanding is wrong.

Oldenburg answered 10/10, 2013 at 17:48 Comment(0)
T
2

So when you define the sourceAddress using the actual IP address then it only works for remote systems. If you only want to forward local connections try 127.0.0.1 but if you want to forward both use 0.0.0.0.

Thwack answered 28/1, 2020 at 16:23 Comment(0)
B
1

Set listenaddress and connectaddress to actual address in LAN (e.g. 192.168.1.15, depending on your router and dhcp). Not localhost

Bacteroid answered 16/11, 2013 at 17:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.