This commit is contained in:
Eugene Pankov
2022-03-08 23:05:50 +01:00
parent 6a96637932
commit d4fb56b30b
3 changed files with 120 additions and 81 deletions

View File

@@ -1,3 +1,4 @@
import at from 'core-js-pure/actual/array/at'
import * as fs from 'fs/promises'
import * as fsSync from 'fs'
import * as path from 'path'
@@ -77,7 +78,7 @@ export class OpenSSHImporter extends SSHProfileImporter {
type: PortForwardType.Local,
description: value,
host: bind.includes(':') ? bind.split(':')[0] : '127.0.0.1',
port: parseInt(bind.split(':').at(-1)),
port: parseInt(at(bind.split(':'), -1)),
targetAddress: tgt.split(':')[0],
targetPort: parseInt(tgt.split(':')[1]),
})
@@ -88,7 +89,7 @@ export class OpenSSHImporter extends SSHProfileImporter {
type: PortForwardType.Dynamic,
description: value,
host: bind.includes(':') ? bind.split(':')[0] : '127.0.0.1',
port: parseInt(bind.split(':').at(-1)),
port: parseInt(at(bind.split(':'), -1)),
targetAddress: '',
targetPort: 22,
})