frpsvc

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 19 Imported by: 0

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()
}

Frps is a running frps.

func Start

func Start(ctx context.Context, quic *QUIC, headerTimeout time.Duration, onDomain func(domain string, added bool)) (*Frps, error)

Start runs frps on loopback. A non-nil quic also opens QUIC on public UDP 443. headerTimeout is how long a visitor's request waits for the origin's response headers, in whole seconds; 0 is frp's default.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL