是否有一种方法可以远程调用ASP。网络开发Web服务器?

时间:2021-11-26 13:24:55

I know that generally speaking, this cant be done, that is get another PC to call a site hosted under the ASP.NET DEvelopment Web Server remotely (generally you can only use localhost:port to get to it).

我知道,一般来说,这是不可能的,那就是让另一台PC机调用一个位于ASP下的站点。NET DEvelopment Web服务器远程(通常只能使用localhost:port来访问它)。

But I was wondering if anyone has seen, or knows of a way to get around it? I am a RESTful API developer in my office, and I would like the PHP guys to test the APIs on my machine so that I can have the Visual Studio 2005 debugger attached, and I can more easily find problems.

但我想知道是否有人见过,或者知道如何绕过它?我在我的办公室是一个RESTful API开发人员,我希望PHP人员可以在我的机器上测试API,这样我就可以有Visual Studio 2005调试器附件,并且我可以更容易地找到问题。

THe main issue is, that my machine is a Vista machine, and unfortunately, the APIs I have developed do not work under IIS7, even Classic Application Pool mode (which eliminates hosting them on a local IIS impossible).

主要的问题是,我的机器是一台Vista机器,不幸的是,我开发的api在IIS7下不能工作,甚至是经典的应用程序池模式(不可能在本地IIS上托管它们)。

Alternatively, is there a way to use IIS6 on another machine to suite my needs?

或者,是否有一种方法可以在另一台机器上使用IIS6来满足我的需求?

Update

更新

Based on the advise that I have gotten and after much trial and error with the suggestions made, I was able to get Squid to act as a reverse-proxy and do exactly what I wanted to do. I have blogged about it http://www.ashleyangell.com/index.php/2009/03/configuring-a-basic-reverse-proxy-in-squid-on-windows-website-accelerator/ in case anyone else wants to do the same thing.

基于我已经得到的建议,经过多次尝试和错误的建议,我能够让乌贼扮演一个反向代理,并做我想做的事情。我曾在http://www.ashleyangell.com/index.php/2009/03/configuring-a-basic-reverse-proxy-in- squion -windows- websitesator/等网站上发表过相关文章,以防有人也想这么做。

10 个解决方案

#1


3  

Can't you just run IIS7 in Classic Application Pool mode?

难道你不能在经典的应用程序池模式下运行IIS7吗?

The Development Web Server is strictly limited to Localhost, you would either need to decompile and recompile it, or set up some kind of Proxy on your machine.

开发Web服务器严格限于Localhost,您需要对其进行分解和重新编译,或者在您的机器上设置某种类型的代理。

And on an unrelated Topic: Even though Win2003 Server SP2 R2 should be supported up to March 2012, maybe IIS7 Support should be added to your application to make sure you can run on 2008 Server as well.

另一个无关的话题是:即使Win2003服务器SP2 R2应该在2012年3月之前被支持,也许IIS7的支持应该被添加到你的应用程序中,以确保你能在2008年的服务器上运行。

#2


14  

This is substantially easier than the Squid option:

这比乌贼的选择简单得多:

"Accessing the Visual Studio ASP.NET Development Server from iPhone"

“访问Visual Studio ASP。来自iPhone的网络开发服务器"

Also there is an update that works well under Windows 7, too:

此外,Windows 7下的更新也运行良好:

"iPhone Accessing the Visual Studio ASP.NET Development Server - Windows 7 Update"

iPhone访问Visual Studio ASP。NET开发服务器- windows7更新"

#3


7  

I have just tried http://code.activestate.com/recipes/483732-asynchronous-port-forwarding/ successfully. It's a Python script that just forwards the traffic.

我刚刚成功地尝试了http://code.activestate.com/recipes/483732-异步端口转发/。它是一个Python脚本,只是转发流量。

Assuming the machine your dev server runs on is 192.168.42.42 and the dev server is on port 12345, run the script (on the same machine) with the command line arguments

假设您的开发服务器运行的机器是192.168.42.42,而开发服务器位于端口12345上,那么使用命令行参数运行脚本(在同一台机器上)

-l 192.168.42.42 -p 8000 -r 127.0.0.1 -P 12345

From a different machine, you can then access the server via http://192.168.42.42:8000.

然后,您可以从另一台机器上通过http://192.168.42.42:8000访问服务器。

Be sure to change sender.handle_close as noted by Dwight Walker in the comments:

一定要更改发送方。德怀特·沃克在评论中指出:

def handle_close(self):
    self.close()
    if len(self.receiver.to_remote_buffer) == 0:
        self.receiver.close()

#4


3  

You can debug remotely to a computer with IIS6. Check this blog post on how to set it up: http://blogs.iis.net/brian-murphy-booth/archive/2008/05/23/remoting-debugging-asp-net-applications-using-visual-studio-2008.aspx

您可以使用IIS6远程调试到计算机。查看这篇关于如何设置它的博文:http://blogs.iis.net/brian-murphy-booth/archive/2008/05/23/remoting-debugging-asp-net应用程序- use - visualstudio2008 .aspx

Here is a link for vs2005: http://aspnet2holes.blogspot.com/2006/11/debug-aspnet-20-running-under-iis-60.html. I still recommend to check the 2008 one, just for some extra comments it has.

下面是vs2005的链接:http://aspnet2holes.blogspot.com/2006/11/debug-aspnet 20-running-under-iis 60.html。我仍然建议检查一下2008年的版本,仅仅是为了一些额外的评论。

#5


2  

Basically i spent 5 hours making this work, and ultimately if you want a 5 min fix here goes:

基本上,我花了5个小时来完成这个工作,如果你想要5分钟的修复,你可以这样做:

1. Port forward incoming traffic to your local ip on your network
TCP Any -> 3127-3128
TCP Any -> 80-81
TCP Any -> 8080
TCP Any -> 8000
TCP Any -> 8888
to
192.1681.1.3 (the local ip of the machine running .NET Dev server.)

2. Download SPI Port Forward

3. Heres the tricky part - Setup 2 forwarding rules as follows:
Local port: 8080 Remote: localhost Remote port 8080
Local port: 8080 Remote: localhost Remote port: .NET Dev server port

Without that second rule the .NET dev server wont serve the page

4. now visit your public IP address at port 8080 -- and you got it

Z

Z

#6


1  

You might want to take a look at UltiDev's version of the Cassini web server. They took the Microsoft Open Source Cassini web server and enhanced it to allow among other things, remote connections.

您可能想看看UltiDev版本的Cassini web服务器。他们采用了微软的开源卡西尼web服务器,并对其进行了增强,以允许远程连接。

You can attach VS to the process, and watch your RESTful APIs being called from the PHP application, exactly as you describe above.

您可以将VS附加到进程,并观察从PHP应用程序调用RESTful api,正如您上面所描述的那样。

#7


1  

Just use a simple Java TCP tunnel. Download this Java app & just tunnel the traffic back. No messing with IIS necessary!

只需使用一个简单的Java TCP隧道。下载这个Java应用程序,让流量恢复正常。没有必要弄乱IIS !

http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml

http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml

In command prompt, you'd then run the java app like this... Let's assume you want external access on port 80 and your standard debug environment runs on port 1088...

在命令提示符中,您将这样运行java应用程序……假设您希望在端口80上进行外部访问,而您的标准调试环境在端口1088上运行……

java -jar tunnel.jar 80 localhost 1088 (Also answered here: Accessing asp. net development server external to VM)

java jar隧道。jar 80 localhost 1088(也在这里回答:访问asp。VM外部的net开发服务器)

#8


0  

Switching IIS 7 to Classic pipeline does not resolve your compatibility issues? VS 2005 has a remote debugger, as did many versions before that.

将iis7切换到经典管道并不能解决兼容性问题?vs2005有一个远程调试器,和之前的许多版本一样。

#9


0  

YES THERE IS! :D

是的有!:D

I was also looking around to overcome this limitation for some time and accidentally I stumbled upon following article:

我也在寻找克服这个限制一段时间,偶然发现下面的文章:

http://eeichinger.blogspot.com/2009/12/sniff-http-traffic-with-aspnet.html

http://eeichinger.blogspot.com/2009/12/sniff-http-traffic-with-aspnet.html

I haven't tried it myself yet, but looks quick & simple (although some may say this is hardcore).
BTW. I recommend you look at some other posts at Erich Eichinger's blog, since there's more really valuable stuff.

我自己还没有尝试过,但是看起来很快而且简单(尽管有些人可能会说这是核心)。顺便说一句。我建议你去看看Erich Eichinger博客上的其他文章,因为那里有更有价值的东西。

#10


0  

This post helped me: http://staticvoidmain.cognitioab.se/index.php/2013/01/remote-debugging-asp-net-development-server-with-spi-port-forward/ It suggests using a third-party application on your developer machine to act as a proxy (sort of). So you connect to this app, and it forwards all your requests to the development server. Works like magic :)

这篇文章帮助我:http://staticvoidmain.cognitioab.se/index。php/2013/01/remote-debugging-asp-net开发-server-with-spi-port-forward/它建议使用开发人员机器上的第三方应用程序作为代理(某种程度上)。你连接到这个应用,它将你的所有请求转发给开发服务器。就像魔法:)

#1


3  

Can't you just run IIS7 in Classic Application Pool mode?

难道你不能在经典的应用程序池模式下运行IIS7吗?

The Development Web Server is strictly limited to Localhost, you would either need to decompile and recompile it, or set up some kind of Proxy on your machine.

开发Web服务器严格限于Localhost,您需要对其进行分解和重新编译,或者在您的机器上设置某种类型的代理。

And on an unrelated Topic: Even though Win2003 Server SP2 R2 should be supported up to March 2012, maybe IIS7 Support should be added to your application to make sure you can run on 2008 Server as well.

另一个无关的话题是:即使Win2003服务器SP2 R2应该在2012年3月之前被支持,也许IIS7的支持应该被添加到你的应用程序中,以确保你能在2008年的服务器上运行。

#2


14  

This is substantially easier than the Squid option:

这比乌贼的选择简单得多:

"Accessing the Visual Studio ASP.NET Development Server from iPhone"

“访问Visual Studio ASP。来自iPhone的网络开发服务器"

Also there is an update that works well under Windows 7, too:

此外,Windows 7下的更新也运行良好:

"iPhone Accessing the Visual Studio ASP.NET Development Server - Windows 7 Update"

iPhone访问Visual Studio ASP。NET开发服务器- windows7更新"

#3


7  

I have just tried http://code.activestate.com/recipes/483732-asynchronous-port-forwarding/ successfully. It's a Python script that just forwards the traffic.

我刚刚成功地尝试了http://code.activestate.com/recipes/483732-异步端口转发/。它是一个Python脚本,只是转发流量。

Assuming the machine your dev server runs on is 192.168.42.42 and the dev server is on port 12345, run the script (on the same machine) with the command line arguments

假设您的开发服务器运行的机器是192.168.42.42,而开发服务器位于端口12345上,那么使用命令行参数运行脚本(在同一台机器上)

-l 192.168.42.42 -p 8000 -r 127.0.0.1 -P 12345

From a different machine, you can then access the server via http://192.168.42.42:8000.

然后,您可以从另一台机器上通过http://192.168.42.42:8000访问服务器。

Be sure to change sender.handle_close as noted by Dwight Walker in the comments:

一定要更改发送方。德怀特·沃克在评论中指出:

def handle_close(self):
    self.close()
    if len(self.receiver.to_remote_buffer) == 0:
        self.receiver.close()

#4


3  

You can debug remotely to a computer with IIS6. Check this blog post on how to set it up: http://blogs.iis.net/brian-murphy-booth/archive/2008/05/23/remoting-debugging-asp-net-applications-using-visual-studio-2008.aspx

您可以使用IIS6远程调试到计算机。查看这篇关于如何设置它的博文:http://blogs.iis.net/brian-murphy-booth/archive/2008/05/23/remoting-debugging-asp-net应用程序- use - visualstudio2008 .aspx

Here is a link for vs2005: http://aspnet2holes.blogspot.com/2006/11/debug-aspnet-20-running-under-iis-60.html. I still recommend to check the 2008 one, just for some extra comments it has.

下面是vs2005的链接:http://aspnet2holes.blogspot.com/2006/11/debug-aspnet 20-running-under-iis 60.html。我仍然建议检查一下2008年的版本,仅仅是为了一些额外的评论。

#5


2  

Basically i spent 5 hours making this work, and ultimately if you want a 5 min fix here goes:

基本上,我花了5个小时来完成这个工作,如果你想要5分钟的修复,你可以这样做:

1. Port forward incoming traffic to your local ip on your network
TCP Any -> 3127-3128
TCP Any -> 80-81
TCP Any -> 8080
TCP Any -> 8000
TCP Any -> 8888
to
192.1681.1.3 (the local ip of the machine running .NET Dev server.)

2. Download SPI Port Forward

3. Heres the tricky part - Setup 2 forwarding rules as follows:
Local port: 8080 Remote: localhost Remote port 8080
Local port: 8080 Remote: localhost Remote port: .NET Dev server port

Without that second rule the .NET dev server wont serve the page

4. now visit your public IP address at port 8080 -- and you got it

Z

Z

#6


1  

You might want to take a look at UltiDev's version of the Cassini web server. They took the Microsoft Open Source Cassini web server and enhanced it to allow among other things, remote connections.

您可能想看看UltiDev版本的Cassini web服务器。他们采用了微软的开源卡西尼web服务器,并对其进行了增强,以允许远程连接。

You can attach VS to the process, and watch your RESTful APIs being called from the PHP application, exactly as you describe above.

您可以将VS附加到进程,并观察从PHP应用程序调用RESTful api,正如您上面所描述的那样。

#7


1  

Just use a simple Java TCP tunnel. Download this Java app & just tunnel the traffic back. No messing with IIS necessary!

只需使用一个简单的Java TCP隧道。下载这个Java应用程序,让流量恢复正常。没有必要弄乱IIS !

http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml

http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml

In command prompt, you'd then run the java app like this... Let's assume you want external access on port 80 and your standard debug environment runs on port 1088...

在命令提示符中,您将这样运行java应用程序……假设您希望在端口80上进行外部访问,而您的标准调试环境在端口1088上运行……

java -jar tunnel.jar 80 localhost 1088 (Also answered here: Accessing asp. net development server external to VM)

java jar隧道。jar 80 localhost 1088(也在这里回答:访问asp。VM外部的net开发服务器)

#8


0  

Switching IIS 7 to Classic pipeline does not resolve your compatibility issues? VS 2005 has a remote debugger, as did many versions before that.

将iis7切换到经典管道并不能解决兼容性问题?vs2005有一个远程调试器,和之前的许多版本一样。

#9


0  

YES THERE IS! :D

是的有!:D

I was also looking around to overcome this limitation for some time and accidentally I stumbled upon following article:

我也在寻找克服这个限制一段时间,偶然发现下面的文章:

http://eeichinger.blogspot.com/2009/12/sniff-http-traffic-with-aspnet.html

http://eeichinger.blogspot.com/2009/12/sniff-http-traffic-with-aspnet.html

I haven't tried it myself yet, but looks quick & simple (although some may say this is hardcore).
BTW. I recommend you look at some other posts at Erich Eichinger's blog, since there's more really valuable stuff.

我自己还没有尝试过,但是看起来很快而且简单(尽管有些人可能会说这是核心)。顺便说一句。我建议你去看看Erich Eichinger博客上的其他文章,因为那里有更有价值的东西。

#10


0  

This post helped me: http://staticvoidmain.cognitioab.se/index.php/2013/01/remote-debugging-asp-net-development-server-with-spi-port-forward/ It suggests using a third-party application on your developer machine to act as a proxy (sort of). So you connect to this app, and it forwards all your requests to the development server. Works like magic :)

这篇文章帮助我:http://staticvoidmain.cognitioab.se/index。php/2013/01/remote-debugging-asp-net开发-server-with-spi-port-forward/它建议使用开发人员机器上的第三方应用程序作为代理(某种程度上)。你连接到这个应用,它将你的所有请求转发给开发服务器。就像魔法:)