Update socket.js

This commit is contained in:
Karoly Czovek 2024-07-06 15:42:49 +02:00 committed by GitHub
parent 1b5d759f36
commit 8ba0118acf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -237,9 +237,7 @@ module.exports = function appSocket(socket) {
ssh.tryKeyboard = true; ssh.tryKeyboard = true;
ssh.debug = debug('ssh2'); ssh.debug = debug('ssh2');
if ( config.ssh_proxy.ssh_proxy_enabled ) { if ( config.ssh_proxy.ssh_proxy_enabled ) {
conn1.on('ready', () => { conn1.on('ready', () => {
console.log(`vpn.cw :: connection ready over ${config.ssh_proxy.ssh_proxy_host} with user ${config.ssh_proxy.ssh_proxy_user} using ssh key auth`); console.log(`vpn.cw :: connection ready over ${config.ssh_proxy.ssh_proxy_host} with user ${config.ssh_proxy.ssh_proxy_user} using ssh key auth`);
// Alternatively, you could use something like netcat or socat with exec() // Alternatively, you could use something like netcat or socat with exec()
@ -257,22 +255,17 @@ module.exports = function appSocket(socket) {
conn.connect( conn.connect(
ssh ssh
); );
}); });
}).connect({ }).connect({
host: config.ssh_proxy.ssh_proxy_host, host: config.ssh_proxy.ssh_proxy_host,
username: config.ssh_proxy.ssh_proxy_user, username: config.ssh_proxy.ssh_proxy_user,
privateKey: readFileSync(config.ssh_proxy.ssh_proxy_privatekey), privateKey: readFileSync(config.ssh_proxy.ssh_proxy_privatekey),
}); });
} else { } else {
conn.connect( conn.connect(
ssh ssh
); );
} }
} else { } else {
webssh2debug( webssh2debug(
socket, socket,