fix: enable autoConnect
only on /ssh/host/
This commit is contained in:
parent
9cfccb109a
commit
c9591d637d
1 changed files with 13 additions and 8 deletions
|
@ -1,13 +1,13 @@
|
|||
// server
|
||||
// app/connectionHandler.js
|
||||
const createDebug = require("debug")
|
||||
var path = require("path")
|
||||
var fs = require("fs")
|
||||
var extend = require("util")._extend
|
||||
const debug = createDebug("webssh2:connectionHandler")
|
||||
const createDebug = require('debug')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const extend = require('util')._extend
|
||||
const debug = createDebug('webssh2:connectionHandler')
|
||||
|
||||
function handleConnection(req, res, urlParams) {
|
||||
debug("Handling connection")
|
||||
debug('Handling connection')
|
||||
urlParams = urlParams || {}
|
||||
|
||||
const clientPath = path.resolve(
|
||||
|
@ -24,7 +24,12 @@ function handleConnection(req, res, urlParams) {
|
|||
url: req.protocol + '://' + req.get('host'),
|
||||
path: '/ssh/socket.io'
|
||||
},
|
||||
autoConnect: true
|
||||
autoConnect: false // Default to false
|
||||
}
|
||||
|
||||
// Check if the current route is /host/:host
|
||||
if (req.path.startsWith('/ssh/host/')) {
|
||||
tempConfig.autoConnect = true
|
||||
}
|
||||
|
||||
fs.readFile(
|
||||
|
|
Loading…
Reference in a new issue