Skip to content

Commit

Permalink
support websocket raw length
Browse files Browse the repository at this point in the history
  • Loading branch information
ypisetsky committed Oct 16, 2023
1 parent 6de1417 commit a5152a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Libraries/WebSocket/WebSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): any) {
data = BlobManager.createFromOptions(ev.data);
break;
}
this.dispatchEvent(new WebSocketEvent('message', {data}));
const raw_length = ev.raw_length;
if (raw_length == null) {
this.dispatchEvent(new WebSocketEvent('message', {data}));
} else {
this.dispatchEvent(new WebSocketEvent('message', {data, raw_length}));
}
}),
this._eventEmitter.addListener('websocketOpen', ev => {
if (ev.id !== this._socketId) {
Expand Down

0 comments on commit a5152a6

Please sign in to comment.