简体   繁体   English

有关IIS和localhost的问题

[英]Questions about IIS and localhost

I have some really basic questions about IIS and accessing localhost when testing a project in VS. 在VS中测试项目时,我有一些关于IIS和访问localhost的基本问题。 When I test a web application through Visual Studio 2012, it launches an IIS service and the website launches in Chrome with url 当我通过Visual Studio 2012测试Web应用程序时,它会启动IIS服务,并使用url在Chrome中启动网站

http://localhost:23456/home.aspx

I wanted to see if I could access it on the same computer but externally on another tab using 我想看看我是否可以在同一台计算机上访问它,但在外部使用另一个选项卡

http://<myexternalWANIP>:23456/home.aspx

(where myexternalWANIP is my IP address) but I keep getting a Chrome message Oops! Google Chrome could not connect to <myexternalWANIP>:23456 myexternalWANIP是我的IP地址)但我一直收到Chrome消息Oops! Google Chrome could not connect to <myexternalWANIP>:23456 Oops! Google Chrome could not connect to <myexternalWANIP>:23456

I've then shutdown VS2012 and assumed the files would still be available using http://localhost:23456/home.aspx but this now gives the same error. 我然后关闭VS2012并假设文件仍然可以使用http://localhost:23456/home.aspx但现在这给出了同样的错误。

So my questions are 所以我的问题是

  1. How do I test the web application on localhost without opening VS2012? 如何在不打开VS2012的情况下在localhost上测试Web应用程序?
  2. Is it possible to access the site using http://<myexternalWANIP>:23456/home.aspx if testing through VS? 如果通过VS进行测试,是否可以使用http://<myexternalWANIP>:23456/home.aspx访问该站点?
  3. Assuming I get 1. working, is it possible to access the site using http://<myexternalWANIP>:23456/home.aspx when I'm using the same computer and same IP address or does this only work when accessing externally? 假设我得到1.工作,当我使用相同的计算机和相同的IP地址时,是否可以使用http://<myexternalWANIP>:23456/home.aspx访问该站点,或者仅在外部访问时才能使用?
  4. If 3. is not possible, would it work through TOR for instance where I'd be routing from another IP address? 如果3.不可能,它是否可以通过TOR工作,例如我将从另一个IP地址路由?

How do I test the web application on localhost without opening VS2012? 如何在不打开VS2012的情况下在localhost上测试Web应用程序?

You should install (if none) IIS on your local machine, create a web application and deploy your built application there. 您应该在本地计算机上安装(如果没有)IIS,创建Web应用程序并在那里部署构建的应用程序。

Is it possible to access the site using http://:23456/home.aspx if testing through VS? 如果通过VS进行测试,是否可以使用http://:23456 / home.aspx访问该站点?

Open web project settings, on tab 'Web' you should select "Use Custom Web server" option. 打开Web项目设置,在“Web”选项卡上,您应该选择“使用自定义Web服务器”选项。

is it possible to access the site using http://:23456/home.aspx when I'm using the same computer and same IP address or does this only work when accessing externally? 当我使用相同的计算机和相同的IP地址时,是否可以使用http://:23456 / home.aspx访问该站点,或者仅在外部访问时才能使用?

Configure your router to redirect request on specific port to your machine with IIS installed. 配置路由器以在安装了IIS的情况下将特定端口上的请求重定向到您的计算机。

If 3. is not possible, would it work through TOR for instance where I'd be routing from another IP address? 如果3.不可能,它是否可以通过TOR工作,例如我将从另一个IP地址路由?

It should work if point 3 works. 如果第3点工作,它应该工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM