Wednesday, 06 October 2021
  5 Replies
  1.2K Visits
  Subscribe
Hi,

TsgcWebSocketClient with TsgcWSAPI_SocketIO don't work behind proxy.

Watchdog from TsgcWebSocketClient work behind proxy with this properties
Client.Proxy.Username := '';
Client.Proxy.Password := '';
Client.Proxy.ProxyType := pxyHTTP;
Client.Proxy.Host := 192.168.3.60;
Client.Proxy.Port := 8080;

But TsgcWS_API_SocketIO on DoGetSession call oHTTP.Get(DoGetSessionURL, oStream); without parameter proxy into her Client when is TsgcWebSocketClient
2 years ago
·
#824
Hi,

Yes, you are right, there was a bug there, when the TsgcWSAPI_SocketIO was trying to get the Socket.IO session, it wasn't using the proxy configuration of TsgcWebSocketClient. I've fixed this issue and updated the latest beta with this fix included.
Thanks for the feedback.

Kind Regards,
Sergio
2 years ago
·
#825
Hi,
I see your fix, but that d'ont work.

if Client.InheritsFrom(TsgcWSClient) then
oHTTP.Proxy.Assign(TsgcWSClient(Client).Proxy);

to compile there is an error.

oHTTP don't have Proxy property but ProxyParams property

That work when i change property
if Client.InheritsFrom(TsgcWSClient) then
oHTTP.ProxyParams.Assign(TsgcWSClient(Client).Proxy);
2 years ago
·
#826
Kind Regards,
Nir Fitoussi
2 years ago
·
#827
Hello,

The HTTP Client uses the TsgcIdHTTP class, which inherits from TIdHTTP. This class, has a property called "Proxy", it has been added on latest beta. If you get an error that Proxy property is not found when you try to compile, most probably the project is pointing to a old sgcWebSockets version. You can open the unit sgcHTTP_Client.pas and verify that TsgcIdHTTP class has the Proxy property.

Try to verify that the project is pointing to the correct paths or try to uninstall and reinstall again the packages.

I hope this helps.

Kind Regards,
Sergio
2 years ago
·
#828
Hello,

Yes indeed I had watched that the unit sgcWebSocket_API_SocketIO.
I had not seen the new "Proxy" property of TsgcIdHTTP.

Indeed it helps.

Kind Regards,
Nir
  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,jpeg,zip,rar,pdf
· Insert · Remove
  Upload Files (Maximum 10MB)