Skip to content

Commit 63239ed

Browse files
committed
fix connect websocket by setting socket_io_path
1 parent ece9767 commit 63239ed

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

seatable_api/socket_io.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
class SIO(socketio.Client):
1111

12+
def __init__(self, *args, **kwargs):
13+
self.base = kwargs.pop('base')
14+
super().__init__(*args, **kwargs)
15+
1216
def _handle_disconnect(self, namespace):
1317
"""io server disconnect"""
1418
self.logger.info('Engine.IO connection disconnected')
@@ -18,12 +22,16 @@ def _handle_disconnect(self, namespace):
1822
namespace = namespace or '/'
1923
self._trigger_event('io-disconnect', namespace=namespace)
2024

25+
def connect(self, *args, **kwargs):
26+
kwargs['socketio_path'] = '/api-gateway/socket.io'
27+
return super().connect(*args, **kwargs)
28+
2129

2230
class SocketIO(object):
2331

2432
def __init__(self, base):
2533
self.base = base
26-
self.sio = SIO(request_timeout=base.timeout)
34+
self.sio = SIO(request_timeout=base.timeout, base=base)
2735

2836
def __str__(self):
2937
return '<SeaTable SocketIO [ %s ]>' % self.base.dtable_name

0 commit comments

Comments
 (0)