kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
49 wiersze
1.1 KiB
JavaScript
49 wiersze
1.1 KiB
JavaScript
// GridTracker Copyright © 2021 GridTracker.org
|
|
// All rights reserved.
|
|
// See LICENSE for more information.
|
|
|
|
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)
|
|
|
|
}
|