Philipp Hörist pushed to branch master at gajim / python-nbxmpp


Commits:
2969ace9 by Philipp Hörist at 2024-07-06T01:31:21+02:00
fix: Fallback to direct connection if system proxies are not suitable

- - - - -


1 changed file:

- nbxmpp/tcp.py


Changes:

=====================================
nbxmpp/tcp.py
=====================================
@@ -38,11 +38,15 @@ class TCPConnection(Connection):
         Connection.__init__(self, *args, **kwargs)
 
         self._client = Gio.SocketClient.new()
+        self._client.set_protocol(Gio.SocketProtocol.TCP)
         self._client.set_timeout(7)
 
-        if self._address.proxy is not None:
+        if self._address.proxy is None:
+            self._proxy_resolver = Gio.SimpleProxyResolver.new('direct://', 
None)
+        else:
             self._proxy_resolver = self._address.proxy.get_resolver()
-            self._client.set_proxy_resolver(self._proxy_resolver)
+
+        self._client.set_proxy_resolver(self._proxy_resolver)
 
         GObject.Object.connect(self._client, 'event', self._on_event)
 



View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/-/commit/2969ace9dbbf481b523b38ff455c9a874d9de2b1

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/-/commit/2969ace9dbbf481b523b38ff455c9a874d9de2b1
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to