|
|
@ -71,15 +71,21 @@ func loadProxy(settings *config.Config) { |
|
|
|
} |
|
|
|
|
|
|
|
func runProxy(settings *config.Config) { |
|
|
|
if settings.Proxy.Core == "xray" { // xray-core
|
|
|
|
runProcess([]string{"XRAY_LOCATION_ASSET=" + assetDir}, "xray", "-confdir", configDir) |
|
|
|
} else if settings.Proxy.Core == "v2ray" { // v2fly-core
|
|
|
|
runProcess([]string{"V2RAY_LOCATION_ASSET=" + assetDir}, "v2ray", "run", "-d", configDir) |
|
|
|
} else if settings.Proxy.Core == "sagray" { // sager-core
|
|
|
|
runProcess([]string{"V2RAY_LOCATION_ASSET=" + assetDir}, "sagray", "run", "-confdir", configDir) |
|
|
|
} else { |
|
|
|
log.Panicf("Unknown core type -> %s", settings.Proxy.Core) |
|
|
|
//if settings.Proxy.Core == "xray" { // xray-core
|
|
|
|
// runProcess([]string{"XRAY_LOCATION_ASSET=" + assetDir}, "xray", "-confdir", configDir)
|
|
|
|
//} else if settings.Proxy.Core == "v2ray" { // v2fly-core
|
|
|
|
// runProcess([]string{"V2RAY_LOCATION_ASSET=" + assetDir}, "v2ray", "run", "-d", configDir)
|
|
|
|
//} else if settings.Proxy.Core == "sagray" { // sager-core
|
|
|
|
// runProcess([]string{"V2RAY_LOCATION_ASSET=" + assetDir}, "sagray", "run", "-confdir", configDir)
|
|
|
|
//} else {
|
|
|
|
// log.Panicf("Unknown core type -> %s", settings.Proxy.Core)
|
|
|
|
//}
|
|
|
|
assetEnv := []string{ |
|
|
|
"XRAY_LOCATION_ASSET=" + assetDir, // xray asset folder
|
|
|
|
"V2RAY_LOCATION_ASSET=" + assetDir, // v2ray / sagray asset folder
|
|
|
|
} |
|
|
|
// TODO: add proxy bin options
|
|
|
|
runProcess(assetEnv, "xray", "run", "-confdir", configDir) |
|
|
|
} |
|
|
|
|
|
|
|
func runRadvd(settings *config.Config) { |
|
|
|