From 63239edeb0e318f0c270bc25a19999752e7c5ddb Mon Sep 17 00:00:00 2001 From: Alex Happy <1223408988@qq.com> Date: Mon, 30 Jun 2025 17:46:43 +0800 Subject: [PATCH 1/2] fix connect websocket by setting socket_io_path --- seatable_api/socket_io.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/seatable_api/socket_io.py b/seatable_api/socket_io.py index a2dd4bf..e7250df 100644 --- a/seatable_api/socket_io.py +++ b/seatable_api/socket_io.py @@ -9,6 +9,10 @@ class SIO(socketio.Client): + def __init__(self, *args, **kwargs): + self.base = kwargs.pop('base') + super().__init__(*args, **kwargs) + def _handle_disconnect(self, namespace): """io server disconnect""" self.logger.info('Engine.IO connection disconnected') @@ -18,12 +22,16 @@ def _handle_disconnect(self, namespace): namespace = namespace or '/' self._trigger_event('io-disconnect', namespace=namespace) + def connect(self, *args, **kwargs): + kwargs['socketio_path'] = '/api-gateway/socket.io' + return super().connect(*args, **kwargs) + class SocketIO(object): def __init__(self, base): self.base = base - self.sio = SIO(request_timeout=base.timeout) + self.sio = SIO(request_timeout=base.timeout, base=base) def __str__(self): return '' % self.base.dtable_name From 104a95ac0a163968600a3c51bd3c521dfcec031b Mon Sep 17 00:00:00 2001 From: Alex Happy <1223408988@qq.com> Date: Mon, 30 Jun 2025 18:25:56 +0800 Subject: [PATCH 2/2] remove useless code --- seatable_api/socket_io.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/seatable_api/socket_io.py b/seatable_api/socket_io.py index e7250df..3746c5b 100644 --- a/seatable_api/socket_io.py +++ b/seatable_api/socket_io.py @@ -9,10 +9,6 @@ class SIO(socketio.Client): - def __init__(self, *args, **kwargs): - self.base = kwargs.pop('base') - super().__init__(*args, **kwargs) - def _handle_disconnect(self, namespace): """io server disconnect""" self.logger.info('Engine.IO connection disconnected') @@ -31,7 +27,7 @@ class SocketIO(object): def __init__(self, base): self.base = base - self.sio = SIO(request_timeout=base.timeout, base=base) + self.sio = SIO(request_timeout=base.timeout) def __str__(self): return '' % self.base.dtable_name