Documentation ¶
Index ¶
- Variables
- type API
- type Allocate
- type Balancer
- type Client
- type Config
- type DNS
- type Default
- type Detour
- type Dispatcher
- type Freedom
- type Inbound
- type InboundConfiguration
- type LevelPolicy
- type Log
- type Mux
- type Outbound
- type OutboundConfiguration
- type ParamStart
- type Policy
- type ProxySetting
- type Reverse
- type Routing
- type Rule
- type Server
- type Sniffing
- type Socks
- type Stats
- type StreamSettings
- type SystemPolicy
- type Transport
- type User
- type Vmess
- type WebSocket
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // v2ray 服务状态, true 代表运行,false 代表停止。 Protocol string // 协议名称 ID int // 协议id Running = false )
启动成功后保存实例的状态用于关闭
Functions ¶
This section is empty.
Types ¶
type Allocate ¶
type Allocate struct { Strategy string `json:"strategy"` Refresh int `json:"refresh"` Concurrency int `json:"concurrency"` }
Allocate 端口分配设置
type Client ¶
type Client struct { ID string `json:"id"` Level int `json:"level"` AlterID int `json:"alterId"` Email string `json:"email"` }
Client 服务器认可的用户
type Config ¶
type Config struct { Log Log `json:"log"` Inbounds []Inbound `json:"inbounds"` Outbounds []Outbound `json:"outbounds"` }
Config v2ray config struct to json
type DNS ¶
type DNS struct { Hosts string `json:"hosts"` // 静态 IP 列表 Servers Server `json:"servers"` // dns 服务器列表 ClientIP string `json:"clientIp"` // 当前系统的 IP 地址 Tag string `json:"tag"` //标识 }
DNS dns 服务器
type Freedom ¶
type Freedom struct { DomainStrategy string `json:"domainStrategy"` Redirect string `json:"redirect"` UserLevel int `json:"userLevel"` }
Freedom 出站协议,可以用来向任意网络发送(正常的) TCP 或 UDP 数据。
type Inbound ¶
type Inbound struct { Port interface{} `json:"port"` Listen string `json:"listen"` Protocol string `json:"protocol"` Settings interface{} `json:"settings"` // StreamSettings StreamSettings `json:"streamSettings"` // Tag string `json:"tag"` Sniffing Sniffing `json:"sniffing"` }
Inbound 入站连接配置
type LevelPolicy ¶
type LevelPolicy struct { Handshake int `json:"handshake"` ConnIdle int `json:"connIdle"` UplinkOnly int `json:"uplinkOnly"` DownlinkOnly int `json:"downlinkOnly"` StatsUserUplink bool `json:"statsUserUplink"` StatsUserDownlink bool `json:"statsUserDownlink"` BufferSize int `json:"bufferSize"` }
LevelPolicy 策略等级
type Log ¶
type Log struct { Access string `json:"access"` // 访问日志的文件地址 Error string `json:"error"` // 错误日志的文件地址 LogLevel string `json:"loglevel"` // 错误日志的级别 }
Log 日志
type Outbound ¶
type Outbound struct { // SendThrough string // Tag string `json:"tag"` // ProxySettings ProxySetting Protocol string `json:"protocol"` // 默认 vmess 协议 Settings OutboundConfiguration `json:"settings"` StreamSettings StreamSettings `json:"streamSettings"` Mux Mux `json:"mux"` }
Outbound 出站连接配置
type OutboundConfiguration ¶
type OutboundConfiguration struct {
Vnext []interface{} `json:"vnext"`
}
OutboundConfiguration 出口配置
type ParamStart ¶
type ParamStart struct { Protocol string // 协议名称 ID int // 协议 id Address string `json:"address"` Port int `json:"port"` UserID string AlertID int `json:"alertId"` Level int `json:"level"` Security string `json:"security"` Network string `json:"network"` Domains string `json:"domains"` Path string `json:"path"` NetSecurity string }
ParamStart accept parameters pass from network.
type Policy ¶
type Policy struct { Level map[string]LevelPolicy `json:"levels"` System SystemPolicy `json:"system"` }
Policy 本地策略,可以进行权限相关的配置
type Routing ¶
type Routing struct { DomainStrategy string `json:"domainStrategy"` Rules []Rule `json:"rules"` Balancers []Balancer `json:"balancers"` }
Routing 路由
type Rule ¶
type Rule struct { Type string `json:"type"` Domain []string `json:"domain"` IP []string `json:"ip"` Port interface{} `json:"port"` Network string `json:"network"` Source []string `json:"source"` User []string `json:"user"` InboundTag []string `json:"inboundTag"` Protocol []string `json:"protocol"` Attr string `json:"attrs"` OutboundTag string `json:"outboundTag"` BalancerTag string `json:"balancerTag"` }
Rule 规则
type Server ¶
type Server struct { Address string `json:"address"` //dns 服务器地址 Port int `json:"port"` //dns 服务器端口 Domains []string `json:"domains"` // 一个域名列表,此列表包含的域名,将优先使用此服务器进行查询。 ExpectIPs []string `json:"expectIPs"` //一个 IP 范围列表,格式和路由配置中相同。 }
Server dns server 对象
type StreamSettings ¶
type StreamSettings struct { NetWork string `json:"network"` Security string `json:"security"` WSSettings WebSocket `json:"wsSettings"` }
StreamSettings 底层传输配置
type SystemPolicy ¶
type SystemPolicy struct { StatsInboundUplink bool `json:"statsInboundUplink"` StatsInboundDownlink bool `json:"statsInboundDownlink"` }
SystemPolicy 系统策略
type User ¶
type User struct { ID string `json:"id"` AlterID int `json:"alterId"` Security string `json:"security"` Level int `json:"level"` }
User 用户
Click to show internal directories.
Click to hide internal directories.