Add SSH keepalive, fix SOCKS5 format bug, implement web GUI#23
Draft
Add SSH keepalive, fix SOCKS5 format bug, implement web GUI#23
Conversation
Co-authored-by: Sesame2 <103378588+Sesame2@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix git remote connection error
Add SSH keepalive, fix SOCKS5 format bug, implement web GUI
Mar 13, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Git SSH operations (e.g.
git remote show origin) fail with "Connection closed by port 22" because HTTP proxy doesn't intercept SSH traffic, and idle SSH tunnels get dropped by firewalls. Adds keepalive to fix tunnel stability and a web GUI to surface SOCKS5 SSH proxy configuration.Changes
internal/proxy/ssh.go— SSH keepalivekeepAlive()goroutine sendingkeepalive@openssh.comevery 30s viassh.Client.SendRequeststopChan chan struct{}added toSSHClientfor coordinated shutdown;Close()signals the goroutine before tearing down connectionsinternal/proxy/socks5.go— Format verb typo%S→%sinWarnfcall ([%SOCKS5]was emitting a literal bad verb)gui/app.go+cmd/gotun-gui/main.go— Web-based control panelImplements the planned "Tray/GUI frontend" roadmap item. No external dependencies — pure stdlib HTTP server serving a single-page UI.
GET /api/status,POST /api/start,POST /api/stop~/.ssh/configsnippet required to route git SSH through the proxy:Alternative commands (
ncat,connect-proxy) are also shown for environments wherenclacks SOCKS5 (-x) support.Makefilebuildtarget now produces bothgotunandgotun-guibinariesOriginal prompt
创建自 VS Code。
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.