Skip to content

Instantly share code, notes, and snippets.

@nulayuhz
Last active August 29, 2015 14:12
Show Gist options
  • Save nulayuhz/ffc3a720b034c61484c9 to your computer and use it in GitHub Desktop.
Save nulayuhz/ffc3a720b034c61484c9 to your computer and use it in GitHub Desktop.

This is nice to have when you're working on a .Net project that runs inside of a Parallels/VirtualBox VM. Even more important if you are building a mobile site which needs to run on an iPhone. The iPhone emulator does not run in Windows, so during development it is useful to have the Visual Studio server visible to the host operating system.

These instructions were found over here on StackOverflow.

Use Fiddler 2 as a Reverse Proxy to listen on any port (8080 or 8888) and forward those requests to Visual Studio's built-in web server.

Follow the Fiddler setup instructions. The only tricky part here is to use regedit to set a new registry key, a new DWORD named ReverseProxyForPort inside HKEYCURRENTUSER\SOFTWARE\Microsoft\Fiddler2. In this case we set the value to 3480, which is the default server port in Visual Studio 2012.

Find the Window's VMs IP address, and add the following snippet into the existing Fiddler script. Use the Fiddler menus to get to "Rules -> Customize Rules..." Two crucial elements are that the rule is entered into the function OnBeforeRequest, and the rule must use the Window's IP address and localhost as demonstrated below.

if (oSession.host.toLowerCase() == "10.211.55.6:8888") oSession.host = "localhost:3480";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment