You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the websocket adapter in the server sets the connection encoding: with this.connection.setEncoding('utf8');
It thus receives the incoming data as utf8 encoded and splits on \ufffd -- the unicode U+FFFD REPLACEMENT CHARACTER. This is inappropriate as it violates the spec, which indicates that the protocol itself is binary and the individual frames should be interpreted as utf8.
Also, the current internet draft of the WebSocket protocol (after Draft 76) uses a completely different framing method which will mandate parsing in binary. It will no longer be possible to read the bytes as UTF-8. See the latest protocol at http://www.whatwg.org/specs/web-socket-protocol/
It may be acceptable for now to keep the current implementation for now and then switch out the frame parsing entirely to handle implementations of the next official draft. However, be aware that a legitimate message could theoretically legitimately contain \ufffd in a position that doesn't indicate a frame boundary, which would break today's parser.
The text was updated successfully, but these errors were encountered:
Right now, the websocket adapter in the server sets the connection encoding: with this.connection.setEncoding('utf8');
It thus receives the incoming data as utf8 encoded and splits on \ufffd -- the unicode U+FFFD REPLACEMENT CHARACTER. This is inappropriate as it violates the spec, which indicates that the protocol itself is binary and the individual frames should be interpreted as utf8.
Also, the current internet draft of the WebSocket protocol (after Draft 76) uses a completely different framing method which will mandate parsing in binary. It will no longer be possible to read the bytes as UTF-8. See the latest protocol at http://www.whatwg.org/specs/web-socket-protocol/
It may be acceptable for now to keep the current implementation for now and then switch out the frame parsing entirely to handle implementations of the next official draft. However, be aware that a legitimate message could theoretically legitimately contain \ufffd in a position that doesn't indicate a frame boundary, which would break today's parser.
The text was updated successfully, but these errors were encountered: