mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-31 15:06:15 +02:00
WebSockets work with new telnet server
This commit is contained in:
parent
6d307ec06b
commit
e85ba322ce
2 changed files with 106 additions and 102 deletions
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue