diff options
author | Joel Martin <github@martintribe.org> | 2012-10-29 17:17:56 -0500 |
---|---|---|
committer | Joel Martin <github@martintribe.org> | 2012-10-29 17:17:56 -0500 |
commit | c728f43c633192695bfb82c1131056f518e234bc (patch) | |
tree | 7a86188ba1332b944629ed5f712137996760a7b7 /README.md | |
parent | d1458d0063467183147b92383692b02b8f85d366 (diff) | |
download | websockify-c728f43c633192695bfb82c1131056f518e234bc.tar.gz |
README.md: clarify binary vs base64 negotiation.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -11,11 +11,24 @@ the target in both directions. ### WebSockets binary data Websockify supports all versions of the WebSockets protocol (Hixie and -HyBI). The older Hixie versions of the protocol only support UTF-8 +HyBi). The older Hixie versions of the protocol only support UTF-8 text payloads. In order to transport binary data over UTF-8 an -encoding must used to encapsulate the data within UTF-8. Websockify -uses base64 to encode all traffic to and from the client. This does -not affect the data between websockify and the server. +encoding must used to encapsulate the data within UTF-8. + +With Hixie clients, Websockify uses base64 to encode all traffic to +and from the client. This does not affect the data between websockify +and the server. + +With HyBi clients, websockify negotiates whether to base64 encode +traffic to and from the client via the subprotocol header +(Sec-WebSocket-Protocol). The valid subprotocol values are 'binary' +and 'base64' and if the client sends both then the server (the python +implementation) will prefer 'binary'. The 'binary' subprotocol +indicates that the data will be sent raw using binary WebSocket +frames. Some HyBi clients (such as the Flash fallback and older Chrome +and iOS versions) do not support binary data which is why the +negotiation is necessary. + ### Encrypted WebSocket connections (wss://) |