server

package
v0.9.0-dev.9 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: GPL-3.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Token   string
	Store   *state.Store
	Runtime RuntimeAPI
	Now     func() time.Time
}

type RuntimeAPI

type RuntimeAPI interface {
	Capabilities() []string
	Snapshot() state.Snapshot
	Install(context.Context, runtimeapi.Operation) (core.InstallResult, error)
	Restart(context.Context, runtimeapi.Operation) error
	Proxies(context.Context) (mihomo.Proxies, error)
	SelectProxy(context.Context, runtimeapi.Operation, string, string) error
	DelayGroup(context.Context, string, string, int) (mihomo.Delays, error)
	DelayProxy(context.Context, string, string, int) (uint16, error)
	Connections(context.Context) (mihomo.Connections, error)
	CloseConnection(context.Context, runtimeapi.Operation, string) error
	CloseAllConnections(context.Context, runtimeapi.Operation) error
	Rules(context.Context) (mihomo.Rules, error)
	RuleProviders(context.Context) (mihomo.RuleProviders, error)
	UpdateRuleProvider(context.Context, runtimeapi.Operation, string) error
	Stream(context.Context, mihomo.StreamKind, func(json.RawMessage) error) error
	GeoIPStatus(context.Context) (geoip.Status, error)
	LookupGeoIP(context.Context, []netip.Addr) ([]geoip.Record, error)
	UpdateGeoIP(context.Context, runtimeapi.Operation) (geoip.Status, error)
	SystemProxyStatus(context.Context) (protocol.SystemProxyStatus, error)
	EnableSystemProxy(context.Context, runtimeapi.Operation, bool) (protocol.SystemProxyStatus, error)
	DisableSystemProxy(context.Context, runtimeapi.Operation) (protocol.SystemProxyStatus, error)
	TunStatus(context.Context) (protocol.TunStatus, error)
	EnableTun(context.Context, runtimeapi.Operation, bool) (protocol.TunStatus, error)
	DisableTun(context.Context, runtimeapi.Operation) (protocol.TunStatus, error)
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(options Options) *Server

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, listener net.Listener) error

Jump to

Keyboard shortcuts

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