-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add local and dynamic port forward methods
- Loading branch information
1 parent
48c7c43
commit c411d27
Showing
10 changed files
with
1,465 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,9 @@ | |
"main": "./out/main/index.js", | ||
"author": "ShellHub <[email protected]>(https://shellhub.io)", | ||
"homepage": "https://github.com/shellhub-io/desktop", | ||
"engines": { | ||
"node": "^20" | ||
}, | ||
"scripts": { | ||
"format": "prettier --write .", | ||
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix", | ||
|
@@ -17,7 +20,8 @@ | |
"postinstall": "electron-builder install-app-deps", | ||
"build:win": "npm run build && electron-builder --win --config", | ||
"build:mac": "npm run build && electron-builder --mac --config", | ||
"build:linux": "npm run build && electron-builder --linux --config" | ||
"build:linux": "npm run build && electron-builder --linux --config", | ||
"test": "vitest" | ||
}, | ||
"dependencies": { | ||
"@electron-toolkit/preload": "^2.0.0", | ||
|
@@ -31,6 +35,8 @@ | |
"electron-updater": "^6.1.1", | ||
"pinia": "^2.1.7", | ||
"sass": "^1.69.5", | ||
"socksv5": "^0.0.6", | ||
"ssh2": "^1.16.0", | ||
"vee-validate": "^4.12.7", | ||
"vue-router": "^4.2.5", | ||
"vuetify": "^3.4.6", | ||
|
@@ -42,7 +48,7 @@ | |
"@electron-toolkit/eslint-config-ts": "^1.0.0", | ||
"@electron-toolkit/tsconfig": "^1.0.1", | ||
"@rushstack/eslint-patch": "^1.3.3", | ||
"@types/node": "^18.17.5", | ||
"@types/node": "^22.7.4", | ||
"@vitejs/plugin-vue": "^4.3.1", | ||
"@vue/eslint-config-prettier": "^8.0.0", | ||
"@vue/eslint-config-typescript": "^11.0.3", | ||
|
@@ -56,6 +62,7 @@ | |
"typescript": "^5.1.6", | ||
"vite": "^4.4.9", | ||
"vite-plugin-vuetify": "^2.0.1", | ||
"vitest": "^2.1.2", | ||
"vue": "^3.3.4", | ||
"vue-tsc": "^1.8.8" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import EventEmitter from 'node:events' | ||
import ssh2 from 'ssh2' | ||
|
||
export enum SSHEvent { | ||
Auth = 'auth', | ||
Connect = 'connect', | ||
Error = 'error', | ||
Disconnect = 'disconnect' | ||
} | ||
|
||
export class SSHEmitter extends EventEmitter {} | ||
|
||
export type SSHConnectionAuth = { | ||
host: string | ||
username: string | ||
password: string | ||
namespace: string | ||
device: string | ||
} | ||
|
||
export type SSHLocalPortForwardSettings = { | ||
sourceAddr: string | ||
sourcePort: number | ||
destinationAddr: string | ||
destinationPort: number | ||
} | ||
|
||
export type SSHDynamicPortForwardSettings = { | ||
destinationAddr: string | ||
destinationPort: number | ||
} | ||
|
||
export interface SSHConnection { | ||
events: SSHEmitter | ||
client: ssh2.Client | ||
connect(auth: SSHConnectionAuth, settings: any): void | ||
disconnect(): void | ||
onAuth(callback: any): void | ||
onConnect(callback: any): void | ||
onError(callback: any): void | ||
onDisconnect(callback: any): void | ||
} | ||
|
||
export * from './ssh' |
Oops, something went wrong.