Skip to content

Proxy! I need proxy support so eagerly ! #1054

@moses-jin

Description

@moses-jin

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.

TCPTransport.swift.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions