client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SSRStr string = `` /* 157-byte string literal not displayed */
"servers": [{
	"email": "love@xray.com",
	"address": "127.0.0.1",
	"port": 1234,
	"method": "加密方式",
	"password": "密码",
	"level": 0
}]
View Source
var SSStr string = `{
	"servers": [
	  {
		"address": "",
		"port": 1234,
		"method": "2022-blake3-aes-128-gcm",
		"password": ""
	  }
	]
}`
"servers": [{
	"address": "127.0.0.1",
	"port": 1234,
	"users": [{
		"user": "test user",
		"pass": "test pass",
		"level": 0
	}]
}]
View Source
var StreamStr string = `` /* 190-byte string literal not displayed */
View Source
var TrojanStr string = `` /* 131-byte string literal not displayed */
"servers": [{
	"address": "127.0.0.1",
	"port": 1234,
	"password": "password",
	"email": "love@xray.com",
	"level": 0
}]
View Source
var VlessStr string = `` /* 189-byte string literal not displayed */
"vnext": [{
	"address": "example.com",
	"port": 443,
	"users": [{
		"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
		"encryption": "none",
		"flow": "none",
		"level": 0
	}]
}]
View Source
var VmessStr string = `` /* 185-byte string literal not displayed */
"vnext": [{
	"address": "127.0.0.1",
	"port": 37192,
	"users": [{
		"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
		"alterId": 0,
		"security": "auto",
		"level": 0
	}]
}]
View Source
var XrayConfStr string = `` /* 2507-byte string literal not displayed */

Functions

func ParseRawUri

func ParseRawUri(rawUri string) string

func TestSS

func TestSS(rawUri string)

func TestSSR

func TestSSR(rawUri string)

func TestTrojan

func TestTrojan(rawUri string)

func TestVless

func TestVless(rawUri string)

func TestVmess

func TestVmess(rawUri string)

Types

type ClientParams

type ClientParams struct {
	RawUri string
	InPort int
}

type IOutbound

type IOutbound interface {
	GetConfigStr(string) string
	GetRawUri() string
	GetString() string
}

type InBound

type InBound struct {
	Listen string `json:"listen"`
	Port   int    `json:"port"`
	Raw    string `json:"raw"`
}

type SSOutbound

type SSOutbound struct {
	Address  string
	Port     int
	Method   string
	Password string
	Raw      string
}

func (*SSOutbound) GetConfigStr

func (that *SSOutbound) GetConfigStr(rawUri string) (r string)

func (*SSOutbound) GetRawUri

func (that *SSOutbound) GetRawUri() string

func (*SSOutbound) GetString

func (that *SSOutbound) GetString() string

type SSROutbound

type SSROutbound struct {
	Email    string
	Address  string
	Port     int
	Method   string
	Password string
	Raw      string
}

func (*SSROutbound) GetConfigStr

func (that *SSROutbound) GetConfigStr(rawUri string) (r string)

func (*SSROutbound) GetRawUri

func (that *SSROutbound) GetRawUri() string

func (*SSROutbound) GetString

func (that *SSROutbound) GetString() string

type TrojanOutboud

type TrojanOutboud struct {
	Address  string
	Port     int
	Password string
	Email    string
	Security string
	Type     string
	Path     string
	Raw      string
}

func (*TrojanOutboud) GetConfigStr

func (that *TrojanOutboud) GetConfigStr(rawUri string) (r string)

func (*TrojanOutboud) GetRawUri

func (that *TrojanOutboud) GetRawUri() string

func (*TrojanOutboud) GetString

func (that *TrojanOutboud) GetString() string

type VlessOutbound

type VlessOutbound struct {
	Address    string
	Port       int
	UserId     string
	Security   string
	Encryption string
	Type       string
	Path       string
	Raw        string
}

func (*VlessOutbound) GetConfigStr

func (that *VlessOutbound) GetConfigStr(rawUri string) string

func (*VlessOutbound) GetRawUri

func (that *VlessOutbound) GetRawUri() string

func (*VlessOutbound) GetString

func (that *VlessOutbound) GetString() string

type VmessOutbound

type VmessOutbound struct {
	Address  string `json:"address"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	UserId   string `json:"id"`
	Network  string `json:"network"`
	Security string `json:"security"`
	Path     string `json:"path"`
	Raw      string `json:"raw"`
}

func (*VmessOutbound) GetConfigStr

func (that *VmessOutbound) GetConfigStr(rawUri string) string

func (*VmessOutbound) GetRawUri

func (that *VmessOutbound) GetRawUri() string

func (*VmessOutbound) GetString

func (that *VmessOutbound) GetString() string

type XClient

type XClient struct {
	*core.Instance
	RawUri  string
	Out     IOutbound
	ConfStr string
	// contains filtered or unexported fields
}

func NewXClient

func NewXClient(cnf *conf.Conf) *XClient

func (*XClient) Close

func (that *XClient) Close()

func (*XClient) Start

func (that *XClient) Start(params *ClientParams) error

Jump to

Keyboard shortcuts

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