On 07/15/2009 01:59 AM, Ian Hickson wrote: > On Wed, 15 Jul 2009, Mark Nottingham wrote: >> Can you remind me why you need the handshake to look like valid HTTP >> again? I think that's the crux here. > > Because in some cases, people will want to share the same port for their > HTTP server as for their WebSocket server. For example, if they want to do > TLS-WebSocket-over-port-443, in the case where that host also has an HTTPS > server on port 443.
Can such a dual-purpose port-sharing server implement both HTTP and WebSocket stacks and use the right stack depending on the first byte[s] of the incoming message? If port sharing is the primary motivation here, then dual protocol stack support seems like the right solution. This can be even implemented as a dumb TCP-level "switch" application that connects to either an HTTP server or a WebSocket server behind it. No "binary" HTTP messages, no risk of HTTP intermediaries screwing up with the not-really-HTTP-but-looking-like-one traffic. Just two completely different protocols sharing the same port. HTH, Alex.
