Trunk FPC: fphttpclient and proxies lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Renat.Su · 2018-12-17 16:18 I was told here that the proxy for the fphttpclient in the trunk version is implemented. But when I looked at the source code in trunk lazarus (FPC 3.2.0), found at the top of the same comment: 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 { ---------------------------------------------------------------------  Todo:  * Proxy support ?  ---------------------------------------------------------------------} Is there or is there no proxy support?.. Or it is there with some nuances? ---------------------------------------------------------------------- Thaddy · 2018-12-17 19:55 seems a bug in the comment ---------------------------------------------------------------------- Renat.Su · 2018-12-17 20:17 Quote from: Thaddy on December 17, 2018, 08:55:48 pmseems a bug in the comment Thank You! ---------------------------------------------------------------------- balazsszekely · 2018-12-18 05:21 @Renat.Su Please note that only http proxy is implemented. Do not try anything else, for example socks protocol will not work(SOCKS4, SOCKS4a, SOCKS5). ---------------------------------------------------------------------- Thaddy · 2018-12-18 07:42 Quote from: GetMem on December 18, 2018, 06:21:00 am@Renat.Su Please note that only http proxy is implemented. Do not try anything else, for example socks protocol will not work(SOCKS4, SOCKS4a, SOCKS5). Correct, but these would be implemented elsewhere in the code base, probably fpsockets or in a separate unit. ---------------------------------------------------------------------- Renat.Su · 2018-12-18 08:01 Quote from: GetMem on December 18, 2018, 06:21:00 am@Renat.Su Please note that only http proxy is implemented. Do not try anything else, for example socks protocol will not work(SOCKS4, SOCKS4a, SOCKS5). Yes, I understand. To begin with http proxy would be nice ---------------------------------------------------------------------- Renat.Su · 2018-12-18 20:58 Hm... Tested: TFPHTTPClient: HTTP -  worked HTTPS - worked HTTP with proxy - worked HTTPS with proxy - not worked That's sad. Unsecured sites at HTTP not so many, so it left turns proxies almost useless. Or I do not know some nuance? P.S. Tested with various web sites and HTTP proxies ---------------------------------------------------------------------- Renat.Su · 2019-01-03 15:44 So, post the result of my research at the moment  TFPHTTPClient HTTP -  worked HTTPS - worked HTTP with proxy - worked (only trunk FPC) HTTPS with proxy - not worked Synapse HTTPClient THTTPSend class HTTP -  worked HTTPS - worked HTTP with proxy - worked HTTPS with proxy - worked (Windows) HTTPS with proxy - not worked (Linux: Debian x86_84) or works with the hack (see post below) Indy 10 HTTPClient TIdHTTP HTTP -  worked HTTPS - worked HTTP with proxy - worked HTTPS with proxy - worked    Further I wrote a basic client class emulating properties and functions (so far the ones I need) and separated the HTTP client from implementation. Accordingly, it will be possible to connect the required HTTP client by registering its implementation class. If anyone is interested - an example here where basehttpclient.pas - base abstract http client class fphttpclientbroker.pas -native TFPHTTPClient implementation synapsehttpclientbroker.pas - Synapse THTTPSend implementation indyhttpclientbroker.pas - Indy TIdHTTP implementation ---------------------------------------------------------------------- Renat.Su · 2020-02-12 14:19 I found (thanks @ashumkin) the feature that I want to share with others if they encounter it Synapse can works with proxy+HTTPS in Linux if change the code in the synapse library... You must to comment or delete the line Port:= IntToStr(ResolvePort(Port)); in blcksock.pas 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 TTCPBlockSocket.HTTPTunnelDoConnect(IP, Port: string);//bugfixed by Mike Green (mgreen@emixode.com)var  s: string;begin  //Port := IntToStr(ResolvePort(Port));   inherited Connect(FHTTPTunnelIP, FHTTPTunnelPort);  if FLastError <> 0 then    Exit;  FHTTPTunnel := False; ---------------------------------------------------------------------- Segator · 2020-05-25 15:31 HTTPS over HTTPS Proxy is not implemented yet in TFPHTTPClient? ---------------------------------------------------------------------- Renat.Su · 2020-05-25 15:42 Quote from: Segator on May 25, 2020, 05:31:43 pmHTTPS over HTTPS Proxy is not implemented yet in TFPHTTPClient? No, as I know. But You can use synapse or Indy for this. I had to make it possible to connect different HTTP libraries using the broker system