tags:

views:

74

answers:

1

Hello.

Im trying to stop using TcpTrace and start working with Fiddler.

But i just can't setup fiddler to just start listening specified port and redirect all requests to the specified WS with another port.

All i want is just redirect and monitor all traffic from localhost:4747 -> webservice-ip:10000
Is there any solution for my problem ?

Thanks in advance.

+1  A: 

Set Fiddler to listen on port 4747, and then edit your CustomRules.js (menu->Rules->Customize Rules). Putting something like this into the OnBeforeRequest method should help:

if (oSession.host=="localhost:4747") {
  oSession.host="external:1000";
}

if you want all traffic passing through Fiddler to go to the external host, you can simply use

oSession.host="external:1000";

(where external is the hostname of the external host)

Piskvor
See also http://www.fiddler2.com/fiddler/dev/scriptsamples.asp for other useful snippets you can use in your CustomRules.
Piskvor
thank you! that helped a lot!
Konoplianko
@Konoplianko: You're welcome. Had a similar problem some time ago :) (Fiddler ROCKS!)
Piskvor
I have another problem. now fiddler responses with its own content.
Konoplianko
@Konoplianko: That should only happen when the target server is unreachable...
Piskvor
i wrote in the script: oSession.host="10.233.103.53:10000"; but that means it doesnt works then.
Konoplianko
@Konoplianko: Direct connection works?
Piskvor
yes. directly it works good. seems that this script doesn't work.
Konoplianko
The redirection script above would only happen if you typed "localhost:4747" into your browser. And that would never work in most browsers because they bypass the proxy for the "localhost" name. You should probably change your "if" condition such that it checks ONLY the port and not the hostname and port.
EricLaw -MSFT-