Can't access Visual Studio project from IP, only http://localhost

后端 未结 5 888
忘了有多久
忘了有多久 2021-01-17 19:25

I\'m running a project in visual studio. I hit run and it launches IE pointing at http://localhost:1267

If I try to visit http://10.211.55.3:1267

相关标签:
5条回答
  • 2021-01-17 20:09

    If you are using the Visual Studio Development Server (and not IIS,) your server will only bind to localhost. You can not use another IP address to access it. If you must, you can work around this with proxies.

    If you are running IIS, make sure that your web server is binding to all addresses (0.0.0.0)

    0 讨论(0)
  • 2021-01-17 20:12

    CygWin Solution (no proxy install needed)

    ssh USER@OTHER_HOST -R IIS_PORT:localhost:IIS_PORT
    

    replace USER, OTHER_HOST and IIS_PORT. Now you can browse with your OTHER_HOST to the testpage on localhost:IIS_PORT. This enables you the ability to test your stuff on remote Linux hosts (for example).

    0 讨论(0)
  • 2021-01-17 20:16

    Try Changing the IIS server to Local Right Click Web Project - Properties - Web - Select Local IIS

    0 讨论(0)
  • 2021-01-17 20:21

    For IIS Express, you need to grant yourself permission to bind to network adapters other than localhost, and configure IIS express to bind to all adapters. If you desire access from another computer, you need to also open the port on your firewall. This answer details these steps.

    0 讨论(0)
  • 2021-01-17 20:22

    To do this you need to edit applicationhost.config file manually

    <bindings>
       <binding protocol="http" bindingInformation="*:57177:localhost" />
       <binding protocol="http" bindingInformation="*:57177:127.0.0.1" />
    </bindings>
    

    Aplication will be accessible on:

    localhost:57177
    127.0.0.1:57177
    

    If you want remote access, I think adding your IP address and disabling firewall will do it.

    0 讨论(0)
提交回复
热议问题