Skip to content

Commit 08c1e3e

Browse files
authored
Merge pull request #12 from chr314/master
Send messages as string
2 parents b42382c + 441dad8 commit 08c1e3e

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

lib/client.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ class RPCClient extends EventEmitter {
169169
sendRaw(buffer) {
170170
if ([OPEN, CLOSING].includes(this._state) && this._ws) {
171171
// can send while closing so long as websocket doesn't mind
172-
if (!Buffer.isBuffer(buffer)) {
173-
buffer = Buffer.from(buffer, 'utf8');
174-
}
175172
this._ws.send(buffer);
176173
this.emit('message', {buffer, outbound: true});
177174
} else if (this._state === CONNECTING) {
@@ -805,4 +802,4 @@ RPCClient.CONNECTING = CONNECTING;
805802
RPCClient.CLOSING = CLOSING;
806803
RPCClient.CLOSED = CLOSED;
807804

808-
module.exports = RPCClient;
805+
module.exports = RPCClient;

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)