idHTTPProxyServer through another Http proxy lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- RDL · 2018-04-05 08:44 Good day. It is not possible to redirect requests to another proxy server. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TfrmMain.IdHTTPProxyServerHTTPBeforeCommand(AContext: TIdHTTPProxyServerContext);vartProxy: TIdCustomTransparentProxy;begint Proxy:=TIdCustomTransparentProxy.Create(AContext.Connection);tProxy.Ho st:='127.0.0.1';tProxy.Port:=8888;tProxy.Enabled:=true;AContext.Connec tion.Socket.TransparentProxy:=tProxy; end; I need through http (get, post). I know how to redirect requests using the "Connect" method, but it does not work with all proxy servers. I need your help. ---------------------------------------------------------------------- Remy Lebeau · 2018-04-10 17:41 It doesn't work because you are setting it up the wrong way. TIdCustomTransparentProxy is an abstract base class, do not instantiate it directly.  You need to use a descendant instead (TIdSocksInfo for a SOCKS proxy, TIdConnectThroughHttpProxy for an HTTP proxy, etc). But more importantly, you are attaching the TransparentProxy to the wrong TCP connection.  'AContext.Connection' is the existing established TCP connection with the client that connected to TIdHTTPProxyServer.  To pass that client's traffic with the target server through another proxy, you need to attach the TransparentProxy to 'AContext.OutboundClient' instead. Try something more like this: Code: [Select]procedure TfrmMain.IdHTTPProxyServerHTTPBeforeCommand(AContext: TIdHTTPProxyServerContext); var   tProxy: TIdConnectThroughHttpProxy; begin   AContext.OutboundClient.CreateIOHandler;   tProxy := TIdConnectThroughHttpProxy.Create(AContext.OutboundClient.IOHandler);   tProxy.Host := '127.0.0.1';   tProxy.Port := 8888;   tProxy.Enabled := true;   AContext.OutboundClient.Socket.TransparentProxy := tProxy; end;