This is an old revision of the document!


WebSockets


아쉽게도 실제 머신의 소켓에 바인딩 해주는 것은 아니며 HTTP가 사용하는 TCP 80포트에서 약간의 헤더를 붙인 Framing Protocol 을 운용하는 일종의 소켓 에뮬레이션에 가까운 디자인. 따라서 HTTP 헤더 오버헤드가 줄어든 통신을 가능하게 하는 장점은 있지만 현재로서는 UDP를 사용한 전송은 불가능하다. 브라우저에서 UDP 소켓을 열 수 있지 않을까 검색하고 있다면 대안으로 WebRTC가 있다.

References

깔끔하고 명료한 설명

비디오 스트리밍에 사용한 사례

혹시 유튜브가 활용하지 않았을까 생각했는데 아직인 듯

제목의 Upgrade가 비유적인 표현인가 했는데 표준에 따르면 hand-shake 시그널이 이렇다.

GET /chat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Origin: http://example.com
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13


Tech


TypeError: Cannot access offset of type string on string

TypeError: Cannot access offset of type string on string

An unforeseen error has occured. This is most likely a bug somewhere.

More info has been written to the DokuWiki error log.