Skip to content

Commit

Permalink
Fix: sendGMCP() now actually sends GMCP data. (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
markscho authored and shawncplus committed Feb 2, 2019
1 parent 6d0e802 commit 91a154d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ class TelnetSocket extends EventEmitter
sendGMCP(gmcpPackage, data) {
const gmcpData = gmcpPackage + ' ' + JSON.stringify(data);
const dataBuffer = Buffer.from(gmcpData);
const seqStartBuffer = new Buffer([Seq.IAC, Seq.SB]);
const seqStartBuffer = new Buffer([Seq.IAC, Seq.SB, Opts.OPT_GMCP]);
const seqEndBuffer = new Buffer([Seq.IAC, Seq.SE]);

this.socket.write(Buffer.concat([seqStartBuffer, dataBuffer, seqEndBuffer], gmcpData.length + 4));
this.socket.write(Buffer.concat([seqStartBuffer, dataBuffer, seqEndBuffer], gmcpData.length + 5));
}

attach(connection) {
Expand Down

0 comments on commit 91a154d

Please sign in to comment.