Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tugberkugurlu/3743292 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/3743292 to your computer and use it in GitHub Desktop.
Allows IISExpress site to be externally accessed (e.g. by VM or iOS device)
:: NOTE needs to be elevated
@set /p HTTP_PORT=Enter Port number [e.g. 10082]:
netsh http add urlacl url=http://*:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://localhost:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://%COMPUTERNAME%:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://%COMPUTERNAME%.local:%HTTP_PORT%/ user=everyone
@pause
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="C:\PathToWebSite" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":1151:localhost" />
<binding protocol="http" bindingInformation="*:1151:pswin8mac.local" />
</bindings>
</site>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment