vapor / websocket-kit

WebSocket client library built on SwiftNIO
https://docs.vapor.codes/4.0/advanced/websockets/
MIT License
272 stars 79 forks source link

How can I use this library to access it via socks5 proxy? #153

Open ljh740 opened 1 month ago

ljh740 commented 1 month ago

Is your feature request related to a problem? Please describe. I would like to make wss requests through a socks5 proxy. For example: user:pwd@127.0.0.1:10086

    ///   - proxy: Host component of the URI for the proxy server.
    ///   - proxyPort: Port on which to connect to the proxy server.

I only see these two parameters, how do I set them up and use them?

Describe the solution you'd like use it

Describe alternatives you've considered null

0xTim commented 1 month ago

Pass the host components (auth details and hostname) in the proxy part and the port for the port argument

ljh740 commented 1 month ago

Pass the host components (auth details and hostname) in the proxy part and the port for the port argument

proxy: "user:pwd@127.0.0.1" proxyPort: 10086

some error

NIOPosix.NIOConnectionError(host: "user:pwd@127.0.0.1", port: 10086, dnsAError: Optional(NIOCore.SocketAddressError.unknown(host: "user:pwd@127.0.0.1", port: 10086)), dnsAAAAError: Optional(NIOCore.SocketAddressError.unknown(host: "user:pwd@127.0.0.1", port: 10086)), connectionErrors: [])
0xTim commented 1 month ago

Ah ok, so looks like we'd need to do some work to convert this automatically however if you convert the auth details to an HTTP Basic Auth header and pass that to proxyHeaders that should work