如何在IIS Express中启用远程请求?Scott Guthrie写道,这是可能的,但他没有说明如何实现。


当前回答

我用反向代理的方法解决了这个问题。

我安装了wamp服务器,使用了apache web服务器的简单反向代理功能。

我添加了一个新的端口来监听Apache web服务器(8081)。然后我为该端口添加了虚拟主机代理配置。

<VirtualHost *:8081>
ProxyPass / http://localhost:46935/
ProxyPassReverse / http://localhost:46935/
</VirtualHost>

其他回答

在IIS团队网站上有一篇博客文章解释了如何在IIS Express上启用远程连接。以下是那篇文章的相关部分总结:

在Vista和Win7上,在管理提示符下运行以下命令: Netsh HTTP添加urlacl url=http://vaidesg:8080/ user=everyone 对于XP系统,首先安装Windows XP Service Pack 2 Support Tools。然后在管理提示符下运行以下命令: httpcfg set urlacl /u http://vaidesg1:8080/ /a D:(a;;GX;;;WD)

这是非常棒的,甚至包括HTTPS的漂亮域名:

http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx

非常棒的部分,我在其他地方找不到,以防上面的链接消失:

> C:\Program Files (x86)\IIS Express>IisExpressAdminCmd.exe Usage:
> iisexpressadmincmd.exe <command> <parameters> Supported commands:
>       setupFriendlyHostnameUrl -url:<url>
>       deleteFriendlyHostnameUrl -url:<url>
>       setupUrl -url:<url>
>       deleteUrl -url:<url>
>       setupSslUrl -url:<url> -CertHash:<value>
>       setupSslUrl -url:<url> -UseSelfSigned
>       deleteSslUrl -url:<url>
> 
> Examples: 1) Configure "http.sys" and "hosts" file for friendly
> hostname "contoso": iisexpressadmincmd setupFriendlyHostnameUrl
> -url:http://contoso:80/ 2) Remove "http.sys" configuration and "hosts" file entry for the friendly  hostname "contoso": iisexpressadmincmd
> deleteFriendlyHostnameUrl -url:http://contoso:80/

上面的实用程序将为您注册SSL证书!如果你使用-UseSelfSigned选项,这非常简单。

如果你想用困难的方式做事,不明显的部分是你需要告诉HTTP。SYS使用什么证书,像这样:

netsh http add sslcert ipport=0.0.0.0:443 appid={214124cd-d05b-4309-9af9-9caa44b2b74a} certhash=YOURCERTHASHHERE

Certhash是您可以从MMC中的证书属性中获得的“Thumbprint”。

对于我来说,使用这个相对简单,直接:

通过在扩展对话框中搜索“输送机”下载Visual Studio扩展。然后就安装。

形式: https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti

这个问题的公认答案是如何让IIS Express使用webmatrix的指南。我发现这个指南在使用VS 2010时更有用。

我只是按照步骤3和4(以管理员身份运行IIS Express),并且不得不暂时禁用我的防火墙才能让它工作。

我用反向代理的方法解决了这个问题。

我安装了wamp服务器,使用了apache web服务器的简单反向代理功能。

我添加了一个新的端口来监听Apache web服务器(8081)。然后我为该端口添加了虚拟主机代理配置。

<VirtualHost *:8081>
ProxyPass / http://localhost:46935/
ProxyPassReverse / http://localhost:46935/
</VirtualHost>