-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
My app initiates a SOCKS5 proxy within the app, which requires WebSocket support for the proxy. The reality is that if I use NativeEngine, it is convenient to set proxy parameters in URLSessionConfiguration with almost no changes to the source code. However, NativeEngine has a severe bug that causes message sending and receiving to freeze on devices below iOS 15. Therefore, I have to use WSEngine combined with TCPTransport. I even modified TCPTransport myself to implement the SOCKS5 handshake protocol and successfully connected to the business server through the proxy. But I encountered a problem when sending messages to the business server: "The plain HTTP request was sent to HTTPS port." The issue is that the connection and handshake with the proxy server require plain TCP connections for sending and receiving messages in plaintext, but after the handshake is successful, sending and receiving messages to the business server requires an SSL/TLS connection. I am unable to upgrade the already established TCP connection with the proxy server to support SSL/TLS without disconnecting. I seek help from you or suggestions on how to resolve this issue.
I have attached the modified source code of TCPTransport.