mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 09:27:24 +00:00
fixed .ssh/config port binding parsing - fixes #5906
This commit is contained in:
parent
32170ec640
commit
b31b500727
1 changed files with 4 additions and 4 deletions
|
@ -76,8 +76,8 @@ export class OpenSSHImporter extends SSHProfileImporter {
|
||||||
target.forwardedPorts.push({
|
target.forwardedPorts.push({
|
||||||
type: PortForwardType.Local,
|
type: PortForwardType.Local,
|
||||||
description: value,
|
description: value,
|
||||||
host: bind.split(':')[0] ?? '127.0.0.1',
|
host: bind.includes(':') ? bind.split(':')[0] : '127.0.0.1',
|
||||||
port: parseInt(bind.split(':')[1] ?? bind),
|
port: parseInt(bind.split(':').at(-1)),
|
||||||
targetAddress: tgt.split(':')[0],
|
targetAddress: tgt.split(':')[0],
|
||||||
targetPort: parseInt(tgt.split(':')[1]),
|
targetPort: parseInt(tgt.split(':')[1]),
|
||||||
})
|
})
|
||||||
|
@ -87,8 +87,8 @@ export class OpenSSHImporter extends SSHProfileImporter {
|
||||||
target.forwardedPorts.push({
|
target.forwardedPorts.push({
|
||||||
type: PortForwardType.Dynamic,
|
type: PortForwardType.Dynamic,
|
||||||
description: value,
|
description: value,
|
||||||
host: bind.split(':')[0] ?? '127.0.0.1',
|
host: bind.includes(':') ? bind.split(':')[0] : '127.0.0.1',
|
||||||
port: parseInt(bind.split(':')[1] ?? bind),
|
port: parseInt(bind.split(':').at(-1)),
|
||||||
targetAddress: '',
|
targetAddress: '',
|
||||||
targetPort: 22,
|
targetPort: 22,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue