Skip to content

Instantly share code, notes, and snippets.

@d12frosted
Forked from nsbingham/ngrok-with-IISExpress.md
Last active March 4, 2018 21:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d12frosted/060eb8e0a6d6f1dd0735 to your computer and use it in GitHub Desktop.
Save d12frosted/060eb8e0a6d6f1dd0735 to your computer and use it in GitHub Desktop.
  1. Decide on a subdomain to use with ngrok. This makes the whole process easier.
  2. Open up a Command Prompt in Administrator mode and run the following command to register the URL with HTTP.sys replacing "modernie" with your subdomain and ##### with your VisualStudio/IISExpress application's port.
netsh add urlacl url=http://modernie.ngrok.com:##### user=everyone
  1. Edit your applicationhost.config. The easiest way to is start up the site and right-click the IISExpress icon in the System Tray. Click "Show All Applications" and select your website running at localhost:#####. Click the path next to "Config" to open the file in an editor.
  2. Search for you site's <bindings> configuration. The easiest way is to search for *:#####:localhost, which should bring you to the <bindings> section for your site. Edit them to include the following:
<bindings>
  <binding protocol="http" bindingInformation="*:#####:modernie.ngrok.com" />
  <binding protocol="http" bindingInformation="*:#####:localhost" />
</bindings>

Save the file, making sure to replace "modernie" with your subdomain and ##### with your application's VisualStudio/IISExpress port.

  1. Restart your site.
  2. Run ngrok with the subdomain settings from a Command Prompt running in Administrator mode. This can be done with the following command:
ngrok.exe -authtoken XXXXXXXXXXXXXXXXXXXX -subdomain=modernie #####

Make sure to replace "modernie" with your subdomain and ##### with your application's VisualStudio/IISExpress port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment