chained proxy in delphi

864 Views Asked by At

I just read about chaining proxies and i wanted to try it in delphi, well i played around with indy TIdHttp component and i couldnt figure out how to do it, do i need two TIdHttp components? maybe one sends the request to another?

  http1.ProxyParams.ProxyPort := Port1;
  http1.ProxyParams.ProxyServer := Server1;

  http2.ProxyParams.ProxyPort := Port2;
  http2.ProxyParams.ProxyServer := Server2;

I just want to send some simple GET/POST with the chained proxies.

Is that even doable? or are there any other component to help me with this task?

Thank you.

1

There are 1 best solutions below

0
On

The TIdHTTP.ProxyParams property does not support chaining.

To use chained proxies, you need to:

  1. Assign a TIdIOHandlerSocket-derived component to the TIdHTTP.IOHandler property. Either:

    a. TIdIOHandlerStack, which is Indy's standard TCP/IP implementation.

    b. a TIdSSLIOHandlerSocketBase-derived component, such as TIdSSLIOHandlerSocketOpenSSL. You must use this if you want to work with HTTPS urls.

  2. Assign a TIdCustomTransparentProxy-derived component to the IOHandler's TransarentProxy property. Indy provides two such components by default:

    a. TIdSocksInfo, which implements the SOCKS 4/4a/5 protocols.

    b. TIdConnectThroughHttpProxy, which implements the HTTP CONNECT verb.

  3. Chain multiple TIdCustomTransparentProxy-derived components together via the TIdCustomTransparentProxy.ChainedProxy property.