Skip to content

Commit 5ca2d39

Browse files
authored
Merge pull request #113 from mojojoji/master
Fix buffer trim while sending websocket messages
2 parents e647102 + d362973 commit 5ca2d39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

node-client/src/web-socket-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class WebSocketHandler {
4343

4444
public static handleStandardInput(conn: ws.connection, stdin: stream.Readable | any) {
4545
stdin.on('data', (data) => {
46-
const buff = Buffer.from(data, data.length + 1);
46+
const buff = Buffer.alloc(data.length + 1);
4747
buff.writeInt8(0, 0);
4848
if (data instanceof Buffer) {
4949
data.copy(buff, 1);

0 commit comments

Comments
 (0)