|
@ -40,9 +40,10 @@ function getCommand(socket, sshuser, sshhost, sshport, sshauth, sshkey) { |
|
|
const { request } = socket; |
|
|
const { request } = socket; |
|
|
const match = request.headers.referer.match('.+/ssh/.+$'); |
|
|
const match = request.headers.referer.match('.+/ssh/.+$'); |
|
|
const sshAddress = sshuser ? `${sshuser}@${sshhost}` : sshhost; |
|
|
const sshAddress = sshuser ? `${sshuser}@${sshhost}` : sshhost; |
|
|
|
|
|
const sshPath = sshuser || match ? 'ssh' : path.join(__dirname, 'bin/ssh'); |
|
|
const ssh = match ? `${match[0].split('/ssh/').pop()}@${sshhost}` : sshAddress; |
|
|
const ssh = match ? `${match[0].split('/ssh/').pop()}@${sshhost}` : sshAddress; |
|
|
const sshRemoteOptsBase = [ |
|
|
const sshRemoteOptsBase = [ |
|
|
path.join(__dirname, 'bin/ssh'), |
|
|
sshPath, |
|
|
ssh, |
|
|
ssh, |
|
|
'-p', |
|
|
'-p', |
|
|
sshport, |
|
|
sshport, |
|
|