Documentation
¶
Index ¶
- func ListenAndServe(ctx context.Context, addr string, handler http.Handler) (string, error)
- func ListenAndServeQUIC(ctx context.Context, addr string, handler http.Handler, tlsCfg *tls.Config) error
- func ListenAndServeTLS(ctx context.Context, addr string, handler http.Handler, srv *http.Server) (string, error)
- func Port(addr string) string
- type Config
- type Relay
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
ListenAndServe starts the relay on the given address. Returns the actual address (useful when addr is ":0").
func ListenAndServeQUIC ¶
func ListenAndServeQUIC(ctx context.Context, addr string, handler http.Handler, tlsCfg *tls.Config) error
ListenAndServeQUIC starts an HTTP/3 (QUIC) server on the given UDP address, serving the same handler as the TCP listener. The addr should match the TCP port so clients can reach both protocols on the same host:port.
Types ¶
type Config ¶
type Config struct {
Token string
SSHDAddr string
BufSize int
NoTLS bool
IdleTimeout time.Duration // shut down if no client connected for this long (default 60s)
}
Config holds relay configuration.
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
Relay manages a single SSH session bridged over HTTP streaming.
func (*Relay) Done ¶
func (r *Relay) Done() <-chan struct{}
Done returns a channel that is closed when the sshd connection drops (i.e. the SSH session ended). Callers should shut down the listener.
Click to show internal directories.
Click to hide internal directories.