Documentation
¶
Index ¶
- Variables
- func Serve(addr string, port int, user, pass string) error
- func ServeStunTLS(addr string, port int, sshAddr, certFile, keyFile string) error
- func SetupSOCKS() error
- func SetupSOCKSExternal(user, password string) error
- func SetupSOCKSWithAuth(user, password string) error
- type Server
- type StunTLSServer
Constants ¶
This section is empty.
Variables ¶
var RunAsUser string
RunAsUser overrides the system user for the SOCKS5 service. When non-empty the service runs as this user instead of config.SystemUser. Set this before calling any Setup* function when WARP routing is active.
Functions ¶
func ServeStunTLS ¶ added in v1.6.0
ServeStunTLS starts the built-in TLS+WebSocket SSH proxy.
func SetupSOCKS ¶
func SetupSOCKS() error
SetupSOCKS creates the SOCKS5 proxy service (localhost only).
func SetupSOCKSExternal ¶
SetupSOCKSExternal creates the SOCKS5 proxy on all interfaces (for direct SOCKS5).
func SetupSOCKSWithAuth ¶
SetupSOCKSWithAuth creates the SOCKS5 proxy with auth (localhost only).
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a SOCKS5 proxy server supporting CONNECT with optional auth.
func (*Server) ListenAndServe ¶
ListenAndServe starts the SOCKS5 server (blocking).
type StunTLSServer ¶ added in v1.6.0
type StunTLSServer struct {
// contains filtered or unexported fields
}
StunTLSServer accepts TLS connections and forwards traffic to SSH. It auto-detects whether the client sends a WebSocket upgrade or raw data:
- WebSocket: performs HTTP upgrade, then relays WebSocket binary frames ↔ TCP
- Raw TLS: relays TCP directly (stunnel-compatible)
func NewStunTLSServer ¶ added in v1.6.0
func NewStunTLSServer(listenAddr, sshAddr, certFile, keyFile string) *StunTLSServer
NewStunTLSServer creates a TLS+WebSocket SSH proxy.
func (*StunTLSServer) ListenAndServe ¶ added in v1.6.0
func (s *StunTLSServer) ListenAndServe() error
ListenAndServe starts the TLS listener (blocking).