Exact format for WebSocket request header?

Hey Barry, really appreciate you taking the time to answer :slight_smile:

You’ve come at this from the complete no library end of this…

Yea, there really needs to be an elmofire gif inserted right about here →

Ok, so there’s some confusion somewhere and I only just got up and haven’t made coffee yet so bear with me a bit hehe. The confusion I figure is probably on my part but I’ll run through my understanding of the workings of things:

links to the WebSocket wikipedia entry which is the RFC 6455(RFC 6455 - The WebSocket Protocol) specification of the WebSocket protocol itself which says the initial handshake of a WebSocket itself is an “upgraded” http connection I think that is supposed to include a first set of request headers:

Upgrade: websocket
Connection: Upgrade

which should be mandatory, and expects a response of at least a Status Code of 101 (the Switching Protocols response) and this opens the underlying tcp connection to a full-duplex communication mode rather than http’s usual stateless mode. The WebSocket library used in your examples automatically does those for you as part of the spec
(I really hope I got those right lol)

Now I’m not sure if this is necessary to connect to ws://irc-ws.chat.twitch.tv and now that you say that I’ll check when I get back to my linux box =) only need the get request though? That’d be… odd

OH, but… in retrospect the WebSocket library is probably built on top of the http library and probably includes the request headers in the connection data, I’ll check back in if I discover anything.