Documentation
¶
Index ¶
- Constants
- type Config
- type Gateway
- func (g *Gateway) AddTarget(t Target)
- func (g *Gateway) HandleRDP(w http.ResponseWriter, r *http.Request)
- func (g *Gateway) HandleSSH(w http.ResponseWriter, r *http.Request)
- func (g *Gateway) RegisterHandlers(mux *http.ServeMux)
- func (g *Gateway) RemoveTarget(id int)
- func (g *Gateway) SetTargets(targets []Target)
- func (g *Gateway) Start(ln net.Listener) error
- type Target
Constants ¶
const ListenPort = 39999
ListenPort is the port the browser gateway HTTP server listens on inside the WireGuard netstack. This is a fixed value shared between newt and pangolin. Targets do not overlap with this port because they start at 40000.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// AuthToken is used only for NativeSSH mode (which has no external target
// to match against). For all proxy targets (RDP/SSH/VNC), auth tokens are
// stored per-Target and validated by isAllowed.
AuthToken string
// SSHCredentials are used by native SSH browser sessions for certificate
// validation against the in-memory CA/principal store.
SSHCredentials *nativessh.CredentialStore
}
Config holds the configuration for a Gateway.
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway is a browser-based RDP/SSH/VNC WebSocket proxy. Create one with New and mount it via RegisterHandlers or the individual HandleRDP / HandleSSH / HandleVNC http.HandlerFunc methods.
func (*Gateway) HandleRDP ¶
func (g *Gateway) HandleRDP(w http.ResponseWriter, r *http.Request)
HandleRDP is an http.HandlerFunc for RDP-over-WebSocket connections.
func (*Gateway) HandleSSH ¶
func (g *Gateway) HandleSSH(w http.ResponseWriter, r *http.Request)
HandleSSH is an http.HandlerFunc for SSH-over-WebSocket connections.
func (*Gateway) RegisterHandlers ¶
RegisterHandlers registers the /rdp, /ssh, and /vnc routes on mux.
func (*Gateway) RemoveTarget ¶
RemoveTarget removes an allowed destination by its ID.
func (*Gateway) SetTargets ¶
SetTargets replaces the entire allowed-destination list atomically.
type Target ¶
type Target struct {
ID int
Type string // "rdp" | "ssh" | "vnc"
Destination string
DestinationPort int
AuthToken string // per-target secret; must match the token supplied by the client
}
Target represents an allowed proxy destination for the browser gateway. Only connections whose (Type, Destination, DestinationPort, AuthToken) match a registered Target will be forwarded; all others are rejected.