mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-01-30 20:34:40 +01:00
cleanup
This commit is contained in:
parent
101d9f53b4
commit
c01179b581
2 changed files with 2 additions and 2 deletions
|
@ -154,7 +154,7 @@ class WebSocketProxyHandler(BaseRequestHandler):
|
|||
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':
|
||||
|
|
|
@ -265,6 +265,6 @@ class WebsocketsSSLContext:
|
|||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue