config

package
v0.0.0-...-ee45651 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProxyModelAll or ProxyModelAuto 代理模式
	ProxyModelAll  = "all"
	ProxyModelAuto = "auto"

	ArgPort          = "LocalPort"
	ArgDefaultServer = "DefaultServer"

	ProxyOriginTemplate = "https://%s:%d/stroxy/v1"
	ProxyUrlTemplate    = "wss://%s:%d/stroxy/v1"
)

Variables

This section is empty.

Functions

func Init

func Init()

Init 初始化config模块 为了适配开发环境和发布环境,配置文件可以放在两个位置, 分别是 .../stroxy/client/resources/config.json和.../stroxy/resources/config.json 第二种情况在发布环境

Types

type Group

type Group struct {
	ProxyServerMap ProxyServerMap
	DefaultServer  string
	LocalPort      int    //本地监听端口
	ProxyModel     string //代理模式
	SkipVerify     bool   //跳过tls双向认证
	IpDate         string //ip.txt更新时间
	WebsiteAddr    string //官网地址
	Auth           string //身份信息
	IgnoreAddress  []string
}

Group 解析和处理配置文件

var ProductConfigGroup *Group

func (*Group) GetServerConfig

func (cg *Group) GetServerConfig() *ProxyServer

func (*Group) SetConfigArg

func (cg *Group) SetConfigArg(argName, value string)

type ProxyServer

type ProxyServer struct {
	Name, ProxyOrigin, ProxyUrl, Host, Protocol string
	Port                                        int
}

type ProxyServerMap

type ProxyServerMap map[string]*ProxyServer

func (ProxyServerMap) Init

func (ps ProxyServerMap) Init()

Init 生成Websocket的的URL

Jump to

Keyboard shortcuts

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