I am using Fiddler to debug my MVC application and see all the HTTP requests.
The application is running on http://localhost:51234/mvc
As anybody who has tried to use Fiddler for a site hosted on localhost knows there is an issue - windows won't forward localhost traffic through the proxy if you hit this link directly. You can work around this in several ways, such as my prefered way of using the URL http://ipv4.fiddler:51234/aboutus/contact
. This works great.
The problem was I started doing AJAX using :
<% using (Html.BeginForm()) { %>
If you view the source generated it has actually generated this :
<form action="http://localhost:51234/aboutus/contact" method="post" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, onFailure: Function.createDelegate(this, submitComments_failure), onSuccess: Function.createDelegate(this, submitComments_success) });">
Oops!
It generated localhost
instead of ipv4.fiddler:51234
. So of course when I run the AJAX query Fiddler doesn't see it.
In theory using the machine name should work, but the WebDev.WebServer won't respond if you try to hit directly the machine name http://win-538lf:51234/aboutus/contact
[Fiddler] Connection to win-538lf failed. Exception Text: No connection could be made because the target machine actively refused it fe80::81fc:8f0f:457a:27df%12:51234
Is there a workaround for this?
is it possible to configure WebDev.WebServer to respond to the machine name? Or am I going to have to create a virtual directory or fake host ? I'd prefer not to do that, but i guess its not a big deal.