This commit is contained in:
coletdjnz 2024-05-18 13:54:01 +12:00
parent 101d9f53b4
commit c01179b581
No known key found for this signature in database
GPG key ID: 91984263BB39894A
2 changed files with 2 additions and 2 deletions

View file

@ -154,7 +154,7 @@ class WebSocketProxyHandler(BaseRequestHandler):
def handle(self): def handle(self):
import websockets.sync.server import websockets.sync.server
protocol = websockets.ServerProtocol() protocol = websockets.ServerProtocol()
connection = websockets.sync.server.ServerConnection(socket=self.request, protocol=protocol, close_timeout=0) connection = websockets.sync.server.ServerConnection(socket=self.request, protocol=protocol, close_timeout=2)
connection.handshake() connection.handshake()
for message in connection: for message in connection:
if message == 'proxy_info': if message == 'proxy_info':

View file

@ -265,6 +265,6 @@ class WebsocketsSSLContext:
self.ssl_context = ssl_context self.ssl_context = ssl_context
def wrap_socket(self, sock, server_hostname=None): def wrap_socket(self, sock, server_hostname=None):
if isinstance(sock, ssl.SSLSocket) or WebsocketsSSLTransport: if WebsocketsSSLTransport:
return WebsocketsSSLTransport(sock, self.ssl_context, server_hostname=server_hostname) return WebsocketsSSLTransport(sock, self.ssl_context, server_hostname=server_hostname)
return self.ssl_context.wrap_socket(sock, server_hostname=server_hostname) return self.ssl_context.wrap_socket(sock, server_hostname=server_hostname)