go-socket.io
go-socket.io copied to clipboard
Detecting transport upgrades
Is there a way to detect when a connection upgrades it's transport from long polling to a websocket? In a JS you can hook the upgrade
event on the connnection but I haven't found the equivalent for go (I did a little source code digging but didn't see anything obvious). I'm mostly interested for the purposes of logging the connection change.
Didn't mean to submit this as a bug, but now I can't remove the label :/
I could be wrong but as far as I know there is currently no way to do this. Should be pretty easy to add though.
Check out https://github.com/googollee/go-engine.io and feel free to contribute! :-)
Upgrade funcs: https://github.com/googollee/go-engine.io/blob/master/session.go#L199 https://github.com/googollee/go-engine.io/blob/master/session.go#L213
upgrade() gets called from here: https://github.com/googollee/go-engine.io/blob/master/server.go#L179
@adrianmxb Does it actually?