Vision of the Indian movement in a violinist

I think this is a simple question for someone familiar with Indy. I am using Delphi 2010 and Indy 10. I am trying to access the SSL web service. I think it will be much easier if I can get Fiddler to see my HTTP traffic. I saw messages in StackOverflow that indicate that Fiddler does not see to see your Indy traffic, that you just need to configure the port for it to work. My question is: how do you do this?

Here is my code:

procedure TForm1.Button1Click(Sender: TObject); var slRequest: TStringList; sResponse, sFileName: String; lHTTP: TIdHTTP; lIOHandler: TIdSSLIOHandlerSocketOpenSSL; begin sFileName := 'Ping.xml'; slRequest := TStringList.Create; try slRequest.LoadFromFile(sFileName); lHTTP := TIdHTTP.Create(nil); lHTTP.Intercept := IdLogDebug1; lIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); try lHTTP.IOHandler := lIOHandler; sResponse := lHTTP.Post('https://FSETTESTPROD.EDD.CA.GOV/fsetservice', slRequest); Memo1.Lines.Text := sResponse; finally lIOHandler.Free; end; finally slRequest.Free; end; end; 

Edit: if I do not use a proxy for Fiddler and don’t click the button while Wireshark is working, I get this traffic in Wireshark. enter image description here

+4
source share
1 answer

You can configure Indy to use a proxy script by installing ProxyParams easily:

 try lHTTP.IOHandler := lIOHandler; lHTTP.ProxyParams.ProxyServer := '127.0.0.1'; lHTTP.ProxyParams.ProxyPort := 8888; sResponse := lHTTP.Post('<URL>', slRequest); Memo1.Lines.Text := sResponse; finally lIOHandler.Free; end; 

Then you should see all the traffic in Fiddler.

Edit: if this does not work, you can add the TIdLogDebug component and add it as an interceptor (as in your question). The OnReceive and OnSend events contain complete headers sent and received, as well as response data:

 procedure TForm10.captureTraffic(ASender: TIdConnectionIntercept; var ABuffer: TArray<Byte>); var i: Integer; s: String; begin s := ''; for i := Low(ABuffer) to High(ABuffer) do s := s + chr(ABuffer[i]); Memo1.Lines.Add(s); end; 
+10
source

Source: https://habr.com/ru/post/1395858/


All Articles