mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-08 22:17:07 +01:00
cleanup
This commit is contained in:
parent
101d9f53b4
commit
c01179b581
@ -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':
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user