Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no error or debug output, just 'connection closed' #199

Open
nr0q opened this issue Sep 26, 2021 · 0 comments
Open

no error or debug output, just 'connection closed' #199

nr0q opened this issue Sep 26, 2021 · 0 comments

Comments

@nr0q
Copy link

nr0q commented Sep 26, 2021

I'm trying to write a callback script to connect to a telnet server that after the initial login is pretty much a flow of lines of data from the server to the client (not much user interaction). But I'm not getting the connection bit to work yet even. I'm probably overlocking or overthinking something.

My code

var Telnet = require ('telnet-client')
const g_clusterClient = new Telnet()

var g_clusterServer = {
    host: 'marconi.mchambersradio.com',
    port: 7300,
    loginPrompt: '/login[: ]*$/i',
    // shellPrompt: '/dxspider \>$/i',
    failedLoginMatch: '/is an invalid callsign$/i',
    passwordPrompt: '',
    negotiationMandatory: false,
    username: g_appSettings.myDEcall,
    password: '',
    debug: true,
    timeout: 30000
}

g_clusterClient.on('ready', function(prompt) {
    g_clusterClient.send('', function(err, response) {
        console.log(response)
        console.log(err)
    })
})

g_clusterClient.on('data', function() {
    console.log('Date received')
})

g_clusterClient.on('failedlogin', function() {
    console.log('failed login')
})

g_clusterClient.on('timeout', function() {
    console.log('socket timeout!')
})

g_clusterClient.on('close', function() {
    console.log('connection closed')
})

if (g_mapSettings.offlineMode == false) {
    g_clusterClient.connect(g_clusterServer)
    
}

And in the NWJS dev tools console this is all I see, not much that looks helpful or providing me with useful google search hits.
image

If I've overlooked or overthought something and there's a stackoverflow or google search term that points me in the right direction I won't be offended in the least. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant