webserver

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveNode

func ActiveNode(remoteAddr string, globalProxy bool) []byte

ActiveNode 启用一个远程节点作为系统代理

func CopyV2ray added in v1.3.0

func CopyV2ray(oldConFile, newConFile string, localPort int) []byte

CopyV2ray 复制一份v2ray的json配置文件。并更改入站端口号。

func DeleteV2ray added in v1.3.0

func DeleteV2ray(pid int) []byte

func GetNodes

func GetNodes(domain string) []byte

func GetTpl added in v1.3.0

func GetTpl() *gtpl.Gtpl

func GetV2rayList added in v1.3.0

func GetV2rayList() []byte

func NewWebServer added in v1.3.0

func NewWebServer(webPort int) *web.EasyServer

func RestartV2ray added in v1.3.0

func RestartV2ray(pid int, configFile string) []byte

func RunV2ray added in v1.3.0

func RunV2ray(fpath, msg string) []byte

func StartNodes

func StartNodes() []byte

func TestNodes

func TestNodes(testurl string) []byte

func TplInclude added in v1.3.0

func TplInclude(fpath string, data any) string

func UnActiveNode

func UnActiveNode(remoteAddr string) []byte

func UpdateConf added in v1.3.0

func UpdateConf(dt map[string]string, fpath string) []byte

UpdateConf 更改.env配置文件

func UpdateSubscribe added in v1.3.3

func UpdateSubscribe() []byte

func UpdateV2rayRoutingRules added in v1.3.0

func UpdateV2rayRoutingRules(dt RequestRoutingRules) []byte

UpdateV2rayRoutingRules 更改配置文件的路由规则 更改 .env文件。删除 routing.rules.json 文件。

Types

type BaseResult

type BaseResult struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

func (BaseResult) Bytes

func (b BaseResult) Bytes() []byte

func (*BaseResult) Fail

func (b *BaseResult) Fail(msg string, code int)

func (BaseResult) String

func (b BaseResult) String() string

func (*BaseResult) Success

func (b *BaseResult) Success(msg string)

type HomePageData added in v1.3.0

type HomePageData struct {
	conf.Conf
	TestedDomainList []string
}

type ListData

type ListData struct {
	BaseResult
	Data  any `json:"data"`
	Count int `json:"count"`
}

func NewListData

func NewListData(data any, total int) *ListData

type RequestActiveNode added in v1.3.0

type RequestActiveNode struct {
	RemoteAddr  string `json:"remote_addr"`
	GlobalProxy bool   `json:"global_proxy"`
}

type RequestRoutingRules added in v1.3.0

type RequestRoutingRules struct {
	DirectDomainList []string `json:"direct_domain_list"`
	DirectIpList     []string `json:"direct_ip_list"`
	ProxyDomainList  []string `json:"proxy_domain_list"`
	ProxyIpList      []string `json:"proxy_ip_list"`
}

type V2rayServerData added in v1.3.0

type V2rayServerData struct {
	Pid           int    `json:"pid"`
	LocalPort     int    `json:"local_port"`
	OldConfigFile string `json:"old_config_file"`
	ConfigFile    string `json:"config_file"`
}

Jump to

Keyboard shortcuts

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