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 @@ def __init__(self, *args, proxy_info=None, **kwargs):
def handle(self):
import websockets.sync.server
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()
for message in connection:
if message == 'proxy_info':

View File

@ -265,6 +265,6 @@ def __init__(self, ssl_context: ssl.SSLContext):
self.ssl_context = ssl_context
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 self.ssl_context.wrap_socket(sock, server_hostname=server_hostname)