protocol

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Vmess       = "VMESS"
	Vless       = "VLESS"
	Socks       = "SOCKS"
	Shadowsocks = "SHADOWSOCKS"
)

协议名称

Variables

This section is empty.

Functions

func ParseToData added in v1.5.0

func ParseToData(params Parameter) (content []byte, err error)

ParseToData .

Types

type DeleteParams

type DeleteParams struct {
	ProtocolName string `json:"name"` // 协议名称
	ProtocolID   int    `json:"id"`   // 协议 id
}

DeleteParams 删除协议参数

type Dispatcher

type Dispatcher struct {
}

Dispatcher 协议功能相关的控制器

func (Dispatcher) AddProxyProtocol

func (Dispatcher) AddProxyProtocol(c *gin.Context)

AddProxyProtocol 增加代理协议

func (Dispatcher) ClearProxyProtocol added in v1.4.0

func (Dispatcher) ClearProxyProtocol(c *gin.Context)

ClearProxyProtocol 清空代理协议

func (Dispatcher) DeleteProxyProtocol

func (Dispatcher) DeleteProxyProtocol(c *gin.Context)

DeleteProxyProtocol 删除代理协议

func (Dispatcher) ListProxyProtocols

func (Dispatcher) ListProxyProtocols(c *gin.Context)

ListProxyProtocols 获取用户所有的代理协议

func (Dispatcher) UpdateProxyProtocol

func (Dispatcher) UpdateProxyProtocol(c *gin.Context)

UpdateProxyProtocol 修改代理协议

type Parameter added in v1.5.0

type Parameter struct {
	UID int `json:"uId"` // 登录用户的 id

	ID       int    `json:"id"`       // 协议 id
	Protocol string `json:"protocol"` // 协议名称

	// 协议相关的配置
	Name    string `json:"name"`    // 配置协议别名
	Address string `json:"address"` // 地址
	Port    int    `json:"port"`    // 端口

	// vmess 协议
	UserID  string `json:"userId"`  //  userId
	AlertID int    `json:"alertId"` //   alertId
	// vless 协议参数
	Flow string `json:"flow"`
	// vless 协议参数
	Encryption string `json:"encryption"`
	Level      int    `json:"level"`    //  等级
	Security   string `json:"security"` // 加密方式
	// socks 协议参数
	User   string `json:"user"`
	Passwd string `json:"passwd"`

	Network     string `json:"network"`     // 伪装网络协议类型
	Domains     string `json:"domains"`     // 伪装域名
	Path        string `json:"path"`        // 路径
	NetSecurity string `json:"netSecurity"` // 伪装网络协议的加密方式

	// 用于区分是配置文件导入
	Custom bool `json:"custom"`
	// 配置字符串
	ConfigFile string `json:"configFile"`

	// 国内直连
	Direct bool `json:"direct"`
}

Parameter 协议参数

Jump to

Keyboard shortcuts

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