So, I separated the HTTP client implementation from the lib. By default, the native FPHTTPClient broker will also be used, but it is a good idea to specify the broker explicitly:
Uses ... tgfclhttpcientbroker... ;
Additionally, there is a broker for the synapse library. In this case, instead of
tgfclhttpclientbroker, you should add
tgsynapseclientbroker to the uses block and of course add
laz_synapse to the project dependencies (for example, from the Online Package Manager).
An important consequence and the main reason why I introduced the HTTP client broker system is that it is now possible to use an HTTPS proxy (the native client, unfortunately, does not support) with synapse client broker.
For these purposes, properties have been added to the
TTelegramSender:
property HTTPProxyUser: String read FHTTPProxyUser write FHTTPProxyUser;
property HTTPProxyPassword: String read FHTTPProxyPassword write FHTTPProxyPassword;
property HTTPProxyHost: String read FHTTPProxyHost write FHTTPProxyHost;
property HTTProxyPort: Word read FHTTProxyPort write FHTTProxyPort;
Next, another very important note. There is a bug in laz_synapse that causes the https proxy not works in Linux OS. It is solved by a small hack in the synapse library
https://forum.lazarus.freepascal.org/index.php/topic,43574.msg349074.html#msg349074