This is a migrated thread and some comments may be shown as answers.

map localhost to remote

4 Answers 1396 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
harilal
Top achievements
Rank 1
harilal asked on 25 Jun 2015, 04:54 AM

I am working in a ui project which had a dataservice in a public server. I need to redirect the service calls only to remote . like

http://localhost/project/service/user to http://192.168.3.250:8080/project/service/user

http://localhost/project/service/edit to http://192.168.3.250:8080/project/service/edit

I need to replace the part of the uri and get the response from the remote server. 

 

4 Answers, 1 is accepted

Sort by
0
Eric Lawrence
Telerik team
answered on 25 Jun 2015, 01:19 PM
Hello,

I assume that the service in question is using HTTP or HTTPS, right?

The simplest way to do this is to click Tools > HOSTS.... Click the Checkbox and add a line to the box below:

    192.168.3.250:8080 localhost


Note: if you don't see requests to "localhost" in Fiddler at all, the client is probably using .NET which bypasses the proxy for the "localhost" hostname. You'll need to follow these steps: http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/MonitorLocalTraffic


Regards,
Eric Lawrence
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
harilal
Top achievements
Rank 1
answered on 26 Jun 2015, 03:06 AM
actually i don't need to route all request from local host. only service calls like http://localhost/project/service/* . Am using XAMPP and only http connection.
0
Accepted
Eric Lawrence
Telerik team
answered on 26 Jun 2015, 02:26 PM
Hi, Harilal--

If you need to redirect only some requests from one host to another, you should use script for that instead. First, disable anything you did inside Tools > HOSTS. Then, click Rules > Customize Rules. Scroll to the OnBeforeRequest method and inside it add the following code:


   if (oSession.HostnameIs("localhost") &&
       oSession.uriContains("/project/service/"))
   {
      oSession["X-OverrideHost"] = "192.168.3.250:8080";
   }


Regards,
Eric Lawrence
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
harilal
Top achievements
Rank 1
answered on 29 Jun 2015, 04:00 AM
Thanks Eric it worked .. I have been working on this issue for one week :)
Tags
Fiddler Classic
Asked by
harilal
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
harilal
Top achievements
Rank 1
Share this question
or