hy2

package
v3.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Byte     = 1
	Kilobyte = Byte * 1000
	Megabyte = Kilobyte * 1000
	Gigabyte = Megabyte * 1000
	Terabyte = Gigabyte * 1000
)

Variables

This section is empty.

Functions

func New

func New(c *conf.CoreConfig) (vCore.Core, error)

Types

type GeoLoader

type GeoLoader struct {
	GeoIPFilename   string
	GeoSiteFilename string
	UpdateInterval  time.Duration

	Logger *zap.Logger
	// contains filtered or unexported fields
}

GeoLoader provides the on-demand GeoIP/GeoSite database loading functionality required by the ACL engine. Empty filenames = automatic download from built-in URLs.

func (*GeoLoader) LoadGeoIP

func (l *GeoLoader) LoadGeoIP() (map[string]*v2geo.GeoIP, error)

func (*GeoLoader) LoadGeoSite

func (l *GeoLoader) LoadGeoSite() (map[string]*v2geo.GeoSite, error)

type HookServer

type HookServer struct {
	Tag string

	Counter               sync.Map
	ReportMinTrafficBytes int64
	// contains filtered or unexported fields
}

func (*HookServer) LogOnlineState

func (s *HookServer) LogOnlineState(id string, online bool)

func (*HookServer) LogTraffic

func (h *HookServer) LogTraffic(id string, tx, rx uint64) (ok bool)

func (*HookServer) TraceStream

func (h *HookServer) TraceStream(stream server.HyStream, stats *server.StreamStats)

func (*HookServer) UntraceStream

func (h *HookServer) UntraceStream(stream server.HyStream)

type Hysteria2

type Hysteria2 struct {
	Hy2nodes map[string]Hysteria2node
	Auth     *V2bX
	Logger   *zap.Logger
}

func (*Hysteria2) AddNode

func (h *Hysteria2) AddNode(tag string, info *panel.NodeInfo, config *conf.Options) error

func (*Hysteria2) AddUsers

func (h *Hysteria2) AddUsers(p *vCore.AddUsersParams) (added int, err error)

func (*Hysteria2) Close

func (h *Hysteria2) Close() error

func (*Hysteria2) DelNode

func (h *Hysteria2) DelNode(tag string) error

func (*Hysteria2) DelUsers

func (h *Hysteria2) DelUsers(users []panel.UserInfo, tag string, _ *panel.NodeInfo) error

func (*Hysteria2) GetUserTrafficSlice

func (h *Hysteria2) GetUserTrafficSlice(tag string, reset bool) ([]panel.UserTraffic, error)

func (*Hysteria2) Protocols

func (h *Hysteria2) Protocols() []string

func (*Hysteria2) Start

func (h *Hysteria2) Start() error

func (*Hysteria2) Type

func (h *Hysteria2) Type() string

type Hysteria2node

type Hysteria2node struct {
	Hy2server     server.Server
	Tag           string
	Logger        *zap.Logger
	EventLogger   server.EventLogger
	TrafficLogger server.TrafficLogger
}

type V2bX

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

func (*V2bX) Authenticate

func (v *V2bX) Authenticate(addr net.Addr, auth string, tx uint64) (ok bool, id string)

Jump to

Keyboard shortcuts

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