Windows 7 上的端口转发
如何在 Windows 7 上将端口 xxx 上的传入请求重定向到 localhost:yyy?
开发服务器(相对于 2008)仅允许从本地主机访问,这还不够好。我需要从不同的计算机测试我的应用程序。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
感谢大家的建议,尽管我自己找到了答案。
我下载了 Microsoft SOAP Toolkit 版本 3 并启动了 MSSoapT,在端口 8080 上创建了一个格式化跟踪侦听,转发到主机:127.0.0.1 端口:3804。我的问题是我使用“localhost”而不是“127.0.0.1”。
现在,其他计算机通过端口 8080 向我的开发计算机发出的每个请求都将被重定向到端口 3804,其中 ASP.NET 开发服务器静态设置为在调试 VS.NET Web 应用程序时侦听。
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.
在命令提示符下。
请参阅:http://technet.microsoft.com /en-us/library/cc776297%28WS.10%29.aspx#BKMK_1
On the command prompt.
See: http://technet.microsoft.com/en-us/library/cc776297%28WS.10%29.aspx#BKMK_1
如果这确实用于某些测试,您可以创建一个侦听端口的服务器,当它收到传入连接时会生成一个线程,该线程打开与实际本地服务器的连接,然后等待数据传入任一端并将其拖到另一端。如果任一套接字关闭,工作线程将终止。这显然不是一个可扩展的解决方案,但对于测试来说,它应该很容易达到目的。
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.
不太确定您在寻找什么。但是,当您有路由器并且需要将特定路由器端口上的请求显式转发到 LAN 计算机上的特定 IP 和端口时,端口转发将是相关的。如果您想从同一网络上的其他 LAN 计算机访问 Web 服务器,则 http://ip-address 应该只是工作正常。还要确保您的 Web 服务器正在侦听 LAN IP,而不仅仅是绑定到本地主机。
Not really sure what you are looking for. However port forwarding will be relevant when you have a router in place and you need to explicitly forward a request on a specific router port to a specific IP and port on a LAN computer. If you want to access the web server from other LAN computers on the same network then http://ip-address should just work fine. Also make sure that your web server is listening on the LAN IP and is not just bound to localhost.
我使用的是 Windows 7 64 位,无法让 Microsoft SOAP Toolkit 在我的计算机上进行端口转发,并且不喜欢我在那里找到的免费端口转发软件,所以我只是更改了我的 VS 2010 Web 应用程序来使用本地 iis,我知道这对运行 2008 的人没有帮助,但如果你有 2010,它就可以了...这是我的更改的屏幕截图:我这样做是为了在 iPad 上进行测试...
I'm using windows 7 64 bit and couldn't get the Microsoft SOAP Toolkit to work on my machine for port forwarding and didn't like the free port forwarding software I found out there so I just changed my VS 2010 web app to use local iis, I know this doesn't help people running 2008 but it works if you have 2010... Here's a screen shot of my change: I'm doing this for testing on the iPad...