Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frps ¶
type Frps struct {
// Control serves frp control's WebSocket, which httpsvc hands it
// once it has checked the dark node's certificate: the upgraded
// connection goes to frps in-process, not over loopback.
Control http.Handler
// Vhost is frps's site proxy, called in-process. The edge has already
// parsed the request; it is not written to a port and parsed again.
Vhost http.Handler
// Stop shuts frps down.
Stop func()
// contains filtered or unexported fields
}
Frps is a running frps.
func (*Frps) Groups ¶ added in v0.6.0
Groups counts each dark node's logged-in frpc: the members of its group, which share its names.
func (*Frps) TCPRoute ¶ added in v0.7.0
func (f *Frps) TCPRoute(name string) (group.TCPTLSRoute, bool)
TCPRoute is name's TCP route, if it has one.
func (*Frps) WriteMetrics ¶ added in v0.3.0
WriteMetrics writes the tunnel's metrics: dark nodes, logins, and the work connections that carry site requests.
type Options ¶ added in v0.3.0
type Options struct {
// QUIC, when set, opens frp control on public UDP 443.
QUIC *QUIC
// HeaderTimeout is how long a visitor's request waits for the
// origin's response headers when the request does not say
// (vhost.WithResponseHeaderTimeout), in whole seconds; 0 is frp's
// default.
HeaderTimeout time.Duration
// OnDomain is told when a name gains its first route and loses its last.
OnDomain func(domain string, added bool)
// OnTCPDomain is the same for TCP routes (tcp-tls proxies).
OnTCPDomain func(domain string, added bool)
// Tunnel is the name dark nodes log in on: no proxy may have it.
Tunnel string
// OnProxyError gets each site request frps could not proxy.
OnProxyError func(*http.Request, error)
// Node names the dark node of a tunnel connection's verified client
// certificate, for the per-node session count.
Node func(tls.ConnectionState) string
}
Options are how frps runs in the edge.
type QUIC ¶
type QUIC struct {
ClientCA string // PEM file of the CA that signs dark-node certificates
Certificate func(*tls.ClientHelloInfo) (*tls.Certificate, error)
// Verify runs after the client certificate chain verified; an error
// refuses the connection.
Verify func(tls.ConnectionState) error
}
QUIC is frps's public listener on UDP 443.
Click to show internal directories.
Click to hide internal directories.