Documentation
¶
Index ¶
- Constants
- Variables
- func CompleteMetadataFromReader(m *Metadata, first4 []byte, r io.Reader) (err error)
- func NewDialer(nextDialer netproxy.Dialer, header protocol.Header) (netproxy.Dialer, error)
- func ParseNfsPKeysCSVBase64(csv string) ([][]byte, error)
- func Password2Key(password string) (id []byte, err error)
- type Addons
- type Conn
- func (c *Conn) IntrinsicConn() netproxy.Conn
- func (c *Conn) Read(b []byte) (n int, err error)
- func (c *Conn) ReadFrom(p []byte) (n int, addr netip.AddrPort, err error)
- func (c *Conn) ReadReqHeader() (err error)
- func (c *Conn) ReadRespHeader() (err error)
- func (c *Conn) Write(b []byte) (n int, err error)
- func (c *Conn) WriteTo(p []byte, addr string) (n int, err error)
- type Dialer
- type Fallback
- type FallbackConn
- type FallbackManager
- type Metadata
- type NfsKeyCache
- type VlessConfig
- type VlessServerConfig
- type VlessSettings
- type VlessUser
Constants ¶
View Source
const ( Version = 0 // VLESS 协议版本 AddonDataLenByte = 1 // 附加数据长度字节 ReservedByte = 1 // 保留字节 UUIDBytes = 16 // UUID 字节长度 CmdTCP = 1 // TCP 命令 CmdUDP = 2 // UDP 命令 CmdMux = 3 // 多路复用命令 )
VLESS 协议常量
View Source
const ( AtypIPv4 = 1 // IPv4 地址类型 AtypDomainName = 2 // 域名地址类型 AtypIPv6 = 3 // IPv6 地址类型 )
地址类型常量,兼容 Xray-core
View Source
const ( XRV = "xtls-rprx-vision" // 添加更多 Xray-core 兼容的流控制选项 FlowVisionReality = "xtls-rprx-vision-udp443" FlowOrigin = "xtls-rprx-origin" FlowOriginUDP443 = "xtls-rprx-origin-udp443" FlowDirect = "xtls-rprx-direct" FlowDirectUDP443 = "xtls-rprx-direct-udp443" FlowSplice = "xtls-rprx-splice" FlowSpliceUDP443 = "xtls-rprx-splice-udp443" // 额外的流控制类型(Xray-core 支持的) FlowVisionRealityTCP = "xtls-rprx-vision-tcp443" // 支持的加密模式 // EncryptionNone 定义在 types.go,避免重复声明 EncryptionMLKEM768X25519Plus = "mlkem768x25519plus.native.0rtt" // 传输类型 TransportXHTTP = "xhttp" )
View Source
const ( UserLevelDefault = 0 UserLevelVIP = 1 )
支持的用户级别常量
View Source
const (
EncryptionNone = "none"
)
支持的加密方式常量
Variables ¶
View Source
var (
FailAuthErr = fmt.Errorf("incorrect UUID")
)
View Source
var File_transport_vless_config_proto protoreflect.FileDescriptor
Functions ¶
func ParseNfsPKeysCSVBase64 ¶ added in v0.3.1
ParseNfsPKeysCSVBase64 解析以逗号分隔的 base64url 键列表 每个元素应为单个公钥(X25519 32 字节或 ML-KEM768 1088 字节)的 base64url 表示
func Password2Key ¶
Types ¶
type Addons ¶
type Addons struct {
Flow string `protobuf:"bytes,1,opt,name=Flow,proto3" json:"Flow,omitempty"`
Seed []byte `protobuf:"bytes,2,opt,name=Seed,proto3" json:"Seed,omitempty"`
// contains filtered or unexported fields
}
func (*Addons) Descriptor
deprecated
func (*Addons) ProtoMessage ¶
func (*Addons) ProtoMessage()
func (*Addons) ProtoReflect ¶
func (x *Addons) ProtoReflect() protoreflect.Message
type Conn ¶
func (*Conn) IntrinsicConn ¶
func (*Conn) ReadReqHeader ¶
func (*Conn) ReadRespHeader ¶
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
func (*Dialer) DialContext ¶
type Fallback ¶
type Fallback struct {
Name string // 回退名称
Alpn string // ALPN 协议标识
Path string // 路径匹配
Dest string // 回退目标地址
Xver uint32 // PROXY protocol 版本
}
Fallback 定义 VLESS 协议的回退机制,兼容 Xray-core
type FallbackConn ¶
FallbackConn 包装回退连接
func (*FallbackConn) GetFallbackInfo ¶
func (fc *FallbackConn) GetFallbackInfo() *Fallback
GetFallbackInfo 获取回退信息
type FallbackManager ¶
type FallbackManager struct {
// contains filtered or unexported fields
}
FallbackManager 管理 VLESS 协议的回退机制
func NewFallbackManager ¶
func NewFallbackManager(fallbacks []Fallback) *FallbackManager
NewFallbackManager 创建新的回退管理器
func (*FallbackManager) HandleFallback ¶
func (fm *FallbackManager) HandleFallback(conn netproxy.Conn, alpn, path string) (netproxy.Conn, error)
HandleFallback 处理回退连接
func (*FallbackManager) SelectFallback ¶
func (fm *FallbackManager) SelectFallback(alpn, path string) (*Fallback, error)
SelectFallback 根据连接信息选择合适的回退配置
type NfsKeyCache ¶ added in v0.3.1
type NfsKeyCache struct {
// contains filtered or unexported fields
}
NfsKeyCache 提供基于目标地址的服务端 NFS 公钥链缓存
func (*NfsKeyCache) Set ¶ added in v0.3.1
func (c *NfsKeyCache) Set(server string, keys [][]byte)
type VlessConfig ¶
type VlessConfig struct {
VNext []VlessServerConfig // 服务器列表
}
VlessConfig 定义完整的 VLESS 配置结构
type VlessServerConfig ¶
type VlessServerConfig struct {
Address string // 服务器地址
Port uint32 // 服务器端口
Users []VlessUser // 用户列表
}
VlessServerConfig 定义 VLESS 服务器配置
type VlessSettings ¶
VlessSettings 定义 VLESS 协议设置
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package vision implements VLESS flow `xtls-rprx-vision` introduced by Xray-core.
|
Package vision implements VLESS flow `xtls-rprx-vision` introduced by Xray-core. |
Click to show internal directories.
Click to hide internal directories.