A
A
akkant2020-10-04 01:48:12
Computer networks
akkant, 2020-10-04 01:48:12

How to redirect requests from localhost to another IP in win10?

There is an ubuntu server on the local network, a project is running on this server that listens on port 3000 and gives the site to localhost: 3000, this site requests files already on localhost: 4000. There is no access to the code on the server(!)

Through ssh with windows10 from LAN I can connect to this ubuntu server and site at 192.168.1.25:3000. But a browser opened at 192.168.1.25:3000 from win10 making a request to localhost:4000 will no longer reach the server.
you can't change the localhost address in the hosts file C:\Windows\System32\drivers\etc,
maybe you can redirect all requests to localhost:4000 to 192.168.1.25:4000 using windows10?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2020-10-04
@akkant

Try

netsh interface portproxy add v4tov4 listenport=4000 connectaddress=192.168.1.25 connectport=4000
from this question Windows Port Forwarding
PS https://qastack.ru/superuser/1088309/windows-10-na...
Note that this unfortunately only works for TCP, so if you want to redirect some UDP traffic, you're out of luck.

A
Artem @Jump, 2020-10-04
curated by the

can windows10 redirect all requests to localhost:4000 to 192.168.1.25:4000?

Such forwarding is done using SSH.
https://habr.com/en/post/81607/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question