FIX: minor fixs

This commit is contained in:
Vyacheslav.Sviridov
2024-02-24 19:45:28 +06:00
parent 99ef2a733c
commit b622a7ded7
3 changed files with 13 additions and 9 deletions

View File

@@ -32,8 +32,8 @@ function socketOnClose(event, resolve, reject) {
function socketOnError(error, reject) {
process.stdin.setRawMode(false)
process.stdin.pause()
process.stdin.setRawMode(false)
process.stdin.pause()
reject(error)
}
@@ -55,8 +55,9 @@ async function webSocketSession(headers, socketUrl) {
.resume()
.setEncoding('utf8')
.on('data', (key) => {
if (key === '\u0003') {
socket.send('exit')
if (key === '\u0004') {
socket.close()
socket.send('\u0003')
resolve()
}
socket.send(key)