So I'd like to listen on port 80 for instance and depending on the request, upgrade the connection to WebSocket or leave it as HTTP.
I could have two different servers on two different ports, but that is not what I want as they need to share the same port.
Thank you !
Daniel Tapie
I could have two different servers on two different ports, but that is not what I want as they need to share the same port.
Thank you !
Daniel Tapie
From nw_connection_t's perspective using NWProtocolWebSocket is a pretty drastic change from just reading TCP data at maximum length. This is usually where issues can be introduced. For example, if you have a plain TCP connection and then you need to tell that TCP connection to read web sockets frames instead of chunks of TCP data this can cause issues.Could it be that the problem is that the nw_connection is only partially upgraded and
does not properly format the incoming and outgoing packets ?
One could imagine a custom framer that could be used to handle both scenarios and then just alter it's behavior based upon how the frame headers tell the connection to process the data being sent to the receiver. This would again take quite a bit of interaction with the application layer to handle the manual upgrade, and this then goes back to my point about having to build the application layer from scratch on top of the connection.
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com