1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-09 12:50:23 -05:00

what about this?

This commit is contained in:
coletdjnz 2024-07-14 12:03:25 +12:00
parent 6c585b9de8
commit 4b3fd5f833
No known key found for this signature in database
GPG key ID: 91984263BB39894A

View file

@ -160,7 +160,7 @@ def handle(self):
import websockets.sync.server import websockets.sync.server
self.request.settimeout(None) self.request.settimeout(None)
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=10)
connection.handshake() connection.handshake()
for message in connection: for message in connection:
if message == 'proxy_info': if message == 'proxy_info':
@ -241,7 +241,7 @@ def proxy_server(proxy_server_class, request_handler, bind_ip=None, **proxy_serv
yield f'{bind_address}:{server_port}' yield f'{bind_address}:{server_port}'
finally: finally:
server.shutdown() server.shutdown()
server.server_close() server_thread.join()
class HTTPProxyTestContext(abc.ABC): class HTTPProxyTestContext(abc.ABC):