Skip to content

feat: Add Go SDK host support with V1/V2 relay protocol#611

Draft
avanderhoorn wants to merge 1 commit intomicrosoft:mainfrom
avanderhoorn:avanderhoorn/go-support
Draft

feat: Add Go SDK host support with V1/V2 relay protocol#611
avanderhoorn wants to merge 1 commit intomicrosoft:mainfrom
avanderhoorn:avanderhoorn/go-support

Conversation

@avanderhoorn
Copy link
Copy Markdown
Member

Summary

Add full tunnel host capability to the Go SDK, enabling Go programs to act as tunnel hosts.

Key features

  • V2 relay protocol with direct port forwarding (no nested SSH)
  • V1 protocol support with automatic fallback
  • Reconnection with exponential backoff
  • Automatic access token refresh
  • Connection status callbacks
  • Dynamic port management (AddPort, RemovePort, RefreshPorts)
  • Concurrent client support
  • Comprehensive unit and E2E test coverage

Files added/modified

  • go/tunnels/host.go — Host struct and connect/close/wait lifecycle
  • go/tunnels/host_reconnect.go — Reconnection with backoff and token refresh
  • go/tunnels/connection_status.go — ConnectionStatus enum
  • go/tunnels/tunnel_error.go — Typed error with HTTP status codes
  • go/tunnels/ssh/host_session.go — Dual V1/V2 SSH session handling
  • go/tunnels/ssh/messages/ — V2 wire format messages
  • Full test suite with mock relay infrastructure
  • Host example and documentation updates

Implement full tunnel host capability for the Go SDK, enabling Go
programs to act as tunnel hosts: register endpoints, connect to the
relay over WebSocket, accept client connections via SSH, and forward
traffic to local TCP ports.

Key features:
- V2 relay protocol with direct port forwarding (no nested SSH)
- V1 protocol support with automatic fallback
- Reconnection with exponential backoff
- Automatic access token refresh
- Connection status callbacks
- Dynamic port management (AddPort, RemovePort, RefreshPorts)
- Concurrent client support
- Comprehensive unit and E2E test coverage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant