mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-12-24 13:27:56 +08:00
cmd/verysimple的注释更新和minor change
This commit is contained in:
@@ -23,7 +23,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
download bool
|
download bool
|
||||||
|
|
||||||
extra_preCommands []func()
|
preCommands []func()
|
||||||
|
|
||||||
exitCmds = []exitCmd{
|
exitCmds = []exitCmd{
|
||||||
{name: "sp", desc: "print supported protocols", f: printSupportedProtocols},
|
{name: "sp", desc: "print supported protocols", f: printSupportedProtocols},
|
||||||
@@ -81,16 +81,17 @@ func runExitCommands() (atLeastOneCalled bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 运行 一些 在 加载配置文件前 执行的 命令
|
||||||
func runPreCommands() {
|
func runPreCommands() {
|
||||||
if len(extra_preCommands) > 0 {
|
if len(preCommands) > 0 {
|
||||||
for _, f := range extra_preCommands {
|
for _, f := range preCommands {
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 在开始正式代理前, 先运行一些需要运行的命令与函数
|
// 运行一些 在 加载配置文件后 、开始正式代理前 执行的 命令
|
||||||
func runPreCommandsAfterLoadConf() {
|
func runPreCommandsAfterLoadConf() {
|
||||||
|
|
||||||
if download {
|
if download {
|
||||||
|
|||||||
@@ -342,6 +342,7 @@ func exitBySignal() {
|
|||||||
stopMachineAndExit(mainM)
|
stopMachineAndExit(mainM)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// splice, pprof, urlFormat, dialtimeout
|
||||||
func setupSystemParemeters() {
|
func setupSystemParemeters() {
|
||||||
if disableSplice {
|
if disableSplice {
|
||||||
netLayer.SystemCanSplice = false
|
netLayer.SystemCanSplice = false
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
extra_preCommands = append(extra_preCommands, func() {
|
preCommands = append(preCommands, func() {
|
||||||
if download {
|
if download {
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
//自动下载wintun.dll
|
//自动下载wintun.dll
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import (
|
|||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const eIllegalParameter = "illegal parameter"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
curl -k https://127.0.0.1:48345/api/allstate
|
curl -k https://127.0.0.1:48345/api/allstate
|
||||||
*/
|
*/
|
||||||
@@ -38,6 +40,7 @@ func NewApiServerConf() (ac ApiServerConf) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if fs == nil, flag.CommandLine will be used
|
||||||
func (asc *ApiServerConf) SetupFlags(fs *flag.FlagSet) {
|
func (asc *ApiServerConf) SetupFlags(fs *flag.FlagSet) {
|
||||||
if fs == nil {
|
if fs == nil {
|
||||||
fs = flag.CommandLine
|
fs = flag.CommandLine
|
||||||
@@ -92,8 +95,6 @@ func (m *M) TryRunApiServer() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const eIllegalParameter = "illegal parameter"
|
|
||||||
|
|
||||||
// 阻塞
|
// 阻塞
|
||||||
func (m *M) runApiServer() {
|
func (m *M) runApiServer() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user