How to enable external request in IIS Express?

前端 未结 26 1600
借酒劲吻你
借酒劲吻你 2020-11-22 01:55

How can I enable remote requests in IIS Express? Scott Guthrie wrote that is possible but he didn\'t say how.

26条回答
  •  独厮守ぢ
    2020-11-22 02:48

    There are three changes you might need to make.

    1. Tell IIS Express itself to bind to all ip addresses and hostnames. In your .config file. Typically:
      • VS 2015: $(solutionDir)\.vs\config\applicationhost.config
      • < VS 2015: %userprofile%\My Documents\IISExpress\config\applicationhost.config

    Find your site's binding element, and add

        
    
    1. Setup the bit of Windows called 'http.sys'. As an administrator, run the command:
        netsh http add urlacl url=http://*:8080/ user=everyone
    

    Where everyone is a windows group. Use double quotes for groups with spaces like "Tout le monde".

    1. Allow IIS Express through Windows firewall.

      Start / Windows Firewall with Advanced Security / Inbound Rules / New Rule...

      Program %ProgramFiles%\IIS Express\iisexpress.exe
      OR Port 8080 TCP

    Now when you start iisexpress.exe you should see a message such as

    Successfully registered URL "http://*:8080/" for site "hello world" application "/"

提交回复
热议问题