WebSockets work with new telnet server

This commit is contained in:
Bryan Ashby 2020-05-18 19:19:30 -06:00
parent 6d307ec06b
commit e85ba322ce
No known key found for this signature in database
GPG key ID: B49EB437951D2542
2 changed files with 106 additions and 102 deletions

View file

@ -176,9 +176,6 @@ class TelnetClient {
this.socket.write('\b');
return this._logTrace(command, 'Are You There (AYT) - Replied');
});
// kick off negotiations
this._banner();
}
disconnect() {
@ -189,6 +186,21 @@ class TelnetClient {
}
}
banner() {
this.socket.do.echo();
this.socket.will.echo(); // we'll echo back
this.socket.will.sga();
this.socket.do.sga();
this.socket.do.transmit_binary();
this.socket.will.transmit_binary();
this.socket.do.ttype();
this.socket.do.naws();
this.socket.do.new_environ();
}
_logTrace(info, msg) {
if (Config().loginServers.telnet.traceConnections) {
const log = this.log || Log;
@ -209,21 +221,6 @@ class TelnetClient {
this.clientReadyHandled = true;
this.emit('ready', { firstMenu : Config().loginServers.telnet.firstMenu } );
}
_banner() {
this.socket.do.echo();
this.socket.will.echo(); // we'll echo back
this.socket.will.sga();
this.socket.do.sga();
this.socket.do.transmit_binary();
this.socket.will.transmit_binary();
this.socket.do.ttype();
this.socket.do.naws();
this.socket.do.new_environ();
}
};
inherits(TelnetClient, Client);
@ -236,6 +233,7 @@ exports.getModule = class TelnetServerModule extends LoginServerModule {
createServer(cb) {
this.server = net.createServer( socket => {
const client = new TelnetClient(socket);
client.banner(); // start negotiations
this.handleNewClient(client, socket, ModuleInfo);
});