Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
Update telnet-service.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Akkadius committed Jan 4, 2020
1 parent 79aba45 commit d37b91e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/core/telnet-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
* TCP ping first, respond with error
* @type {any | void}
*/
const ping = await tcpping({address: '127.0.0.1', port: 9000, timeout: 500, attempts: 1});
const ping = await tcpping({ address: '127.0.0.1', port: 9000, timeout: 500, attempts: 1 });
if (!ping.avg) {
return false;
}
Expand All @@ -46,7 +46,7 @@ module.exports = {
shellPrompt: '>',
timeout: 1000,
execTimeout: 1000,
maxBufferLength: '10M',
maxBufferLength: '10M'
}
);

Expand All @@ -58,15 +58,15 @@ module.exports = {
}
);

worldConnection.send("quit", {
worldConnection.send('quit', {
waitfor: 'Connection closed by foreign host$',
maxBufferLength: '10M'
}
);

worldConnection.destroy();

return worldResponse.replace("\n\r>", "").trim();
return worldResponse.replace('\n\r>', '').trim();
},

/**
Expand Down Expand Up @@ -99,7 +99,7 @@ module.exports = {
shellPrompt: '>',
timeout: 1000,
execTimeout: 1000,
maxBufferLength: '10M',
maxBufferLength: '10M'
}
);

Expand All @@ -111,19 +111,19 @@ module.exports = {
}
);

zoneConnection[port].send("quit", {
zoneConnection[port].send('quit', {
waitfor: 'Connection closed by foreign host$',
maxBufferLength: '10M'
}
);

zoneConnection[port].destroy();

return zoneResponse.replace("\n\r>", "").trim();
return zoneResponse.replace('\n\r>', '').trim();

} catch (error) {
console.log(error);
}

},
};
}
};

0 comments on commit d37b91e

Please sign in to comment.