Is there a good overview of websockets? I just glanced at the spec and it looks quite complex. Especially the part about framing. Do websockets have any relation to TCP sockets? If over TCP, why do they use their own framing?
Because TCP doesn't provide any framing - it's just a stream of data. Text based protocols usually use newlines as delimiters, and binary protocols usually prefix each message with a size.