forked from TerminalStudio/dartssh2
-
Notifications
You must be signed in to change notification settings - Fork 2
Merge upstream v2.17.0 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
51ed7a2
fix(web): make SSHSocket import wasm-compatible
vicajilau 1407474
chore(release): bump version to 2.17.0 and update CHANGELOG for Web/W…
vicajilau fcf2de7
fix(changelog): update issue reference for Web/WASM compatibility imp…
vicajilau c37417d
fix(changelog): correct issue reference for Web/WASM compatibility im…
vicajilau c310497
Merge pull request #153 from TerminalStudio/feat/wasm-web-compat-sock…
vicajilau 66384b6
feat: add dynamic SOCKS5 forwarding API
vicajilau 57f426a
test: cover dynamic forward socks flow
vicajilau 10f1da8
test: add comprehensive tests for dynamic SOCKS5 forwarding behavior
vicajilau 080d6d4
test: add unit tests for SSHClient.forwardDynamic authentication flow
vicajilau a2f57cf
Merge pull request #154 from TerminalStudio/feat/dynamic-forward-socks5
vicajilau b54f461
feat: start AEAD groundwork with AES-GCM transport support
vicajilau d60caf3
feat: update CHANGELOG and README to include AES-GCM AEAD groundwork …
vicajilau 2e7887b
fix: keep AES-GCM opt-in to avoid auth regressions
vicajilau 20bad41
feat: update README and CHANGELOG to clarify AES-GCM opt-in status an…
vicajilau 6616eb9
feat: add tests for AES-GCM cipher resolution and SSHTransport AEAD f…
vicajilau 9182d10
refactor: remove unused imports in SSHTransport AEAD test
vicajilau ea6766f
feat: add AEAD cipher tests and enhance SSHTransport functionality
vicajilau 3b57dcd
Merge pull request #155 from TerminalStudio/feat/issue-26-aead-ground…
vicajilau 6977b3c
docs: add note about SSHSocket.connect() limitations for Flutter Web …
vicajilau d41840a
chore: update release date for version 2.17.0 in CHANGELOG.md
vicajilau a386ef1
Merge upstream v2.17.0
GT-610 4db9a55
fix(transport): Fixed AEAD integrity checks and improved random padding
GT-610 f13cb8f
fix: Fixed an issue with resource release when a dynamic forwarding c…
GT-610 52f8e3e
fix: Fixed issues with SSH dynamic forwarding and connection closure
GT-610 f846249
refactor: Simplify connection closure logic and optimize SSH transpor…
GT-610 9bd5f6e
refactor: Optimize code formatting and EOF handling logic
GT-610 20eb905
refactor(SSHTransport): Clean up unused AEAD encryption-related code
GT-610 5e3db54
fix: Fixed issues with connection limits and concurrent dialing
GT-610 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,55 @@ | ||
| import 'dart:async'; | ||
| import 'dart:io'; | ||
|
|
||
| import 'package:dartssh2/dartssh2.dart'; | ||
|
|
||
| Future<void> main() async { | ||
| final host = Platform.environment['SSH_HOST'] ?? 'localhost'; | ||
| final port = int.tryParse(Platform.environment['SSH_PORT'] ?? '') ?? 22; | ||
| final username = Platform.environment['SSH_USERNAME'] ?? 'root'; | ||
| final password = Platform.environment['SSH_PASSWORD']; | ||
|
|
||
| final socket = await SSHSocket.connect(host, port); | ||
|
|
||
| final client = SSHClient( | ||
| socket, | ||
| username: username, | ||
| onPasswordRequest: () => password, | ||
| onVerifyHostKey: (host, verifier) { | ||
| print('WARNING: Host key verification disabled for testing.'); | ||
| return true; | ||
| }, | ||
| ); | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| final dynamicForward = await client.forwardDynamic( | ||
| bindHost: '127.0.0.1', | ||
| bindPort: 1080, | ||
| ); | ||
|
|
||
| print( | ||
| 'SOCKS5 proxy ready on ${dynamicForward.host}:${dynamicForward.port}.', | ||
| ); | ||
| print('Press Ctrl+C to stop.'); | ||
|
|
||
| StreamSubscription<void>? sigintSub; | ||
| StreamSubscription<void>? sigtermSub; | ||
| var isShuttingDown = false; | ||
|
|
||
| Future<void> shutdown() async { | ||
| if (isShuttingDown) return; | ||
| isShuttingDown = true; | ||
|
|
||
| await sigintSub?.cancel(); | ||
| await sigtermSub?.cancel(); | ||
| await dynamicForward.close(); | ||
| client.close(); | ||
| await client.done; | ||
| exit(0); | ||
| } | ||
|
|
||
| sigintSub = ProcessSignal.sigint.watch().listen((_) => shutdown()); | ||
| sigtermSub = ProcessSignal.sigterm.watch().listen((_) => shutdown()); | ||
|
|
||
| await client.done; | ||
| await shutdown(); | ||
| } | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.