Documentation
¶
Index ¶
- func Running() bool
- func SocketPath() string
- type AuditEvent
- type ConnInfo
- type Server
- func (s *Server) Close()
- func (s *Server) Listen() error
- func (s *Server) ListenRemote(addr string) error
- func (s *Server) ListenWeb(addr, certPath, keyPath string) error
- func (s *Server) RequestUDPBridge(targetPort uint16) (relayPort int, relayAddr string, stream *quic.Stream, err error)
- func (s *Server) Serve() error
- func (s *Server) StartRelay(addr, user, device, caFile string) error
- func (s *Server) StopRelay()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuditEvent ¶
type AuditEvent struct {
Time string `json:"time"`
Event string `json:"event"` // "connect", "disconnect", "reject"
Source string `json:"source"` // "local", "ssh", "web", "relay", "web-relay"
RemoteAddr string `json:"remote_addr,omitempty"` // client IP:port
KeyFP string `json:"key_fp,omitempty"` // SSH key fingerprint
KeyComment string `json:"key_comment,omitempty"` // SSH key comment
Session string `json:"session,omitempty"`
Duration string `json:"duration,omitempty"` // only on disconnect
Reason string `json:"reason,omitempty"` // only on reject
}
AuditEvent is a single audit log entry.
type ConnInfo ¶
type ConnInfo struct {
ID uint64
Source string // "local", "ssh", "relay"
RemoteAddr string
KeyComment string
KeyFP string
Session string
ConnectedAt time.Time
// contains filtered or unexported fields
}
ConnInfo describes an active client connection.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the latch daemon, managing sessions over a unix socket.
func (*Server) ListenRemote ¶
ListenRemote starts an SSH server for remote clients.
func (*Server) ListenWeb ¶
ListenWeb starts an HTTPS+WSS server for browser access. Auto-generates a self-signed TLS certificate if none exists. Set certPath/keyPath to empty strings to use defaults (~/.latch/tls.{crt,key}).
func (*Server) RequestUDPBridge ¶ added in v1.0.1
func (s *Server) RequestUDPBridge(targetPort uint16) (relayPort int, relayAddr string, stream *quic.Stream, err error)
RequestUDPBridge asks the relay to bridge a public UDP port to a local mosh port. Returns the relay's public port, public address, and the QUIC stream (kept open for the bridge lifetime).
func (*Server) StartRelay ¶
StartRelay starts the persistent relay connection. Incoming relay streams are SSH ciphertext — they go through the same SSH server handshake as direct SSH connections.