websockets
websockets copied to clipboard
Fix the issue of redirecting from ws to wss.
I found that when configuring our company's Apache server, redirecting ws requests to wss and using this websocket library for connection would result in the error "The plain HTTP request was sent to HTTPS port". After using Wireshark for packet capture, I found that this library did not properly configure SSL. After DEBUG, I confirmed that the problem occurred in the 'handle_redirect' function: 'create_connection' requires the correct use of the SSL keyword.