xray

package
v0.0.0-...-5664bd6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBinaryName

func GetBinaryName() string

func GetBinaryPath

func GetBinaryPath() string

func GetConfigPath

func GetConfigPath() string

func GetGeoipPath

func GetGeoipPath() string

func GetGeositePath

func GetGeositePath() string

Types

type Config

type Config struct {
	LogConfig       json.RawMessage `json:"log"`
	RouterConfig    json.RawMessage `json:"routing"`
	DNSConfig       json.RawMessage `json:"dns"`
	InboundConfigs  []InboundConfig `json:"inbounds"`
	OutboundConfigs json.RawMessage `json:"outbounds"`
	Transport       json.RawMessage `json:"transport"`
	Policy          json.RawMessage `json:"policy"`
	API             json.RawMessage `json:"api"`
	Stats           json.RawMessage `json:"stats"`
	Reverse         json.RawMessage `json:"reverse"`
	FakeDNS         json.RawMessage `json:"fakeDns"`
}

func (*Config) Equals

func (c *Config) Equals(other *Config) bool

type InboundConfig

type InboundConfig struct {
	Listen         json.RawMessage `json:"listen"` // listen 不能为空字符串
	Port           int             `json:"port"`
	Protocol       string          `json:"protocol"`
	Settings       json.RawMessage `json:"settings"`
	StreamSettings json.RawMessage `json:"streamSettings"`
	Tag            string          `json:"tag"`
	Sniffing       json.RawMessage `json:"sniffing"`
}

func (*InboundConfig) Equals

func (c *InboundConfig) Equals(other *InboundConfig) bool

type Process

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

func NewProcess

func NewProcess(xrayConfig *Config) *Process

func (*Process) GetAPIPort

func (p *Process) GetAPIPort() int

func (*Process) GetConfig

func (p *Process) GetConfig() *Config

func (Process) GetErr

func (p Process) GetErr() error

func (Process) GetResult

func (p Process) GetResult() string

func (Process) GetTraffic

func (p Process) GetTraffic(reset bool) ([]*Traffic, error)

func (Process) GetVersion

func (p Process) GetVersion() string

func (Process) IsRunning

func (p Process) IsRunning() bool

func (Process) Start

func (p Process) Start() (err error)

func (Process) Stop

func (p Process) Stop() error

type Traffic

type Traffic struct {
	IsInbound bool
	Tag       string
	Up        int64
	Down      int64
}

Jump to

Keyboard shortcuts

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