socketio / socket.io-client-swift

Other
5.21k stars 838 forks source link

WebSocket doesn't connect through proxy #421

Open ivanornes opened 8 years ago

ivanornes commented 8 years ago

Hi to the socket.io community,

I am trying to connect my app to a socket.io server, behind an elb and a haproxy. The configuration with the sockets should be ok because the web and android clients are already upgrading to websockets.

The connection fallbacks to polling all the time, and I get multiple connect events and sometimes I still get Session ID unknown errors. This happens when the server sends a 500 error and the app tries to reconnect, receiving error 400.

The strange thing is that as soon as I launch the app, I get an endEncountered event in the public func stream(_ aStream: Stream, handle eventCode: Stream.Event) function in the WebSocket.swift file, even if I don´t force the websockets.

captura de pantalla 2016-07-13 a las 10 48 58

The issue is happening with the 6.1.4 and the swift 3 versions of the socket.io-client-swift. The version in the servers socket.io should be the 1.4.8 or 1.4.7.

Thanks

nuclearace commented 8 years ago

This is because the websocket library does not yet support tunneling through proxies. There's an open pull request that adds support for it, but until then it will continue to fail.

https://github.com/daltoniam/Starscream/pull/202

ivanornes commented 8 years ago

Thanks @nuclearace I just tried @oldshuren's socket.io-client-swift fork with proxy connect and almost works. At least I can see the wss connection even if the server is closing it.

captura de pantalla 2016-07-13 a las 16 01 20
nuclearace commented 8 years ago

Hm, I haven't (and probably won't) had time to set up a test setup. But once that pull request is merged and I update the dependency I'll look into a little bit more.

ivanornes commented 8 years ago

I also will try to make it work, thanks!

Dwar3xwar commented 8 years ago

Any updates on this issue?

QaiserAbbas commented 6 years ago

hi, any update or pull is merged or not ? Its long time now on this Issue

jlgl10nes commented 6 years ago

Any updates on this issue? I see it "on hold" For a scalable use of socket.io it's almost a mandatory enhancement to use a load balancer (proxy), the alternatives are painful.

nuclearace commented 6 years ago

It's still blocked by the WebSocket dependency.

megamingus commented 5 years ago

Any updates?

slumtrimpet commented 1 year ago

So um... real talk... is this actually still an issue in 2000 freaking 23?

ivanornes commented 1 year ago

Bad proxy, no issue in the library