Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Port forwarding on Windows 7

How do I redirect an incomming request on port xxx to localhost:yyy on windows 7?

Development Server (vs 2008) only allow access from localhost which isnt good enough. I need to test my app from various computers.

like image 350
user448787 Avatar asked Sep 15 '10 19:09

user448787


3 Answers

On the command prompt.

$> netsh
$> interface portproxy
$> add v4tov4 listenport=xxx connectaddress=127.0.0.1 connectport=yyy protocol=tcp

See: http://technet.microsoft.com/en-us/library/cc776297%28WS.10%29.aspx#BKMK_1

like image 68
Enderson Maia Avatar answered Oct 05 '22 18:10

Enderson Maia


Thanks for the suggestions guys, although I found the answer myself.

I downloaded Microsoft SOAP Toolkit version 3 and started MSSoapT, created a formatted trace listening on port 8080, forwarding to host: 127.0.0.1 port: 3804. My problem was I used "localhost" and not "127.0.0.1".

Now every request made to my development machine from other computers through port 8080 will be redirected to port 3804 where ASP.NET Development Server is statically set to listen when debugging VS.NET webapps.

like image 25
user448787 Avatar answered Oct 05 '22 17:10

user448787


If this really is for some testing, you could create a server which listens on a port, and when it receives an incoming connection spawns a thread that opens a connection to the actual local server, and afterward just waits for data to come in either end and shuffle it along to the other end. If either socket closes, the worker thread would terminate. This is obviously not a scalable solution, but for testing it should easily do the trick.

like image 40
Yuliy Avatar answered Oct 05 '22 18:10

Yuliy