-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Support for Websh based TCP-tunneling #156
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 14 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
3b7fe86
Add smux dependancy
jisung-02 c04d717
Add WebSocket adapter and buffer pool for smux
jisung-02 e2e8a09
Implement TCP tunnel with opentunnel/closetunnel commands
jisung-02 b69c489
Simplify opentunnel command by removing unused fields
jisung-02 8927b9f
Add user credential demotion to tunnel connections for security
jisung-02 75b1648
Merge branch 'main' into 145-tunneling
jisung-02 c7c75c4
Remove unused codes in conn.go and pool.go
jisung-02 c21f8e6
Minor fix
jisung-02 22bcafa
Add strict security validations to tunnel functionality
jisung-02 df6ce04
Modify to run tunnel worker as nobody user instead of specified user
jisung-02 d6d0869
Unify duplicate tunnel_id to session_id
jisung-02 a554688
Merge branch 'main' into 145-tunneling
jisung-02 4ed0c6f
Minor fix
jisung-02 e1f67aa
Fix buffer pool to use pointer indirection for proper reuse
jisung-02 0889a1a
Define constants for readability and place type definitions at the top
jisung-02 94d914f
Move constant definitions to the top to improve readability
jisung-02 3d4494e
Fix to prevent CPU spin in tunnel stream handler
jisung-02 d933cdf
Fix to prevent data loss by ensuring all buffered data is read from b…
jisung-02 f6581a3
Suppress redundant error logs when killing finished processes
jisung-02 146ebf0
Protect WebSocket writes with mutex for concurrent stream safety
jisung-02 0291e0f
Synchronize tunnel deletion to prevent race condition in cleanup
jisung-02 63c7c31
Add port validation and fix potential issues in tunnel client
jisung-02 15c253e
Merge branch 'main' into 145-tunneling
jisung-02 cad3df2
Suppress CodeQL SSRF warning for trusted tunnel URL
jisung-02 dbcb7b0
Reorder const and var declarations to follow Go conventions
jisung-02 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package tunnel | ||
|
|
||
| import ( | ||
| "github.com/alpacax/alpamon/pkg/runner" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| // TunnelWorkerCmd is the subcommand for running the tunnel worker subprocess. | ||
| // It is invoked by the main alpamon process with demoted user credentials. | ||
| var TunnelWorkerCmd = &cobra.Command{ | ||
| Use: "tunnel-worker <targetAddr>", | ||
| Short: "Tunnel worker subprocess for TCP relay", | ||
| Args: cobra.ExactArgs(1), | ||
| Run: func(cmd *cobra.Command, args []string) { | ||
| targetAddr := args[0] // e.g., "127.0.0.1:3306" | ||
| runner.RunTunnelWorker(targetAddr) | ||
| }, | ||
| } |
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
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
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.