|
@ -1,8 +1,8 @@ |
|
|
package main |
|
|
package main |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
|
|
|
log "github.com/sirupsen/logrus" |
|
|
log "github.com/sirupsen/logrus" |
|
|
|
|
|
"os" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
var logLevel = "warning" |
|
|
var logLevel = "warning" |
|
@ -12,27 +12,23 @@ var v6TProxyPort = 7289 |
|
|
var enableSniff = false |
|
|
var enableSniff = false |
|
|
var enableRedirect = true |
|
|
var enableRedirect = true |
|
|
|
|
|
|
|
|
var httpInbounds = make(map[string]int) |
|
|
var httpInbounds map[string]int |
|
|
var socksInbounds = make(map[string]int) |
|
|
var socksInbounds map[string]int |
|
|
|
|
|
var addOnInbounds []interface{} |
|
|
|
|
|
|
|
|
func main() { |
|
|
func main() { |
|
|
log.SetLevel(log.DebugLevel) |
|
|
log.SetLevel(log.DebugLevel) |
|
|
log.Warning("XProxy start") |
|
|
log.Warning("XProxy start") |
|
|
|
|
|
|
|
|
httpInbounds["ipv4"] = 1084 |
|
|
content, err := os.ReadFile("test.yml") |
|
|
httpInbounds["ipv6"] = 1086 |
|
|
if err != nil { |
|
|
fmt.Println(httpInbounds) |
|
|
panic(err) |
|
|
|
|
|
} |
|
|
socksInbounds["nodeA"] = 1681 |
|
|
loadConfig(content) |
|
|
socksInbounds["nodeB"] = 1682 |
|
|
|
|
|
socksInbounds["nodeC"] = 1683 |
|
|
|
|
|
fmt.Println(socksInbounds) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//fmt.Println(httpInbounds)
|
|
|
|
|
|
//fmt.Println(socksInbounds)
|
|
|
|
|
|
//fmt.Println(addOnInbounds)
|
|
|
loadProxy("/etc/xproxy/config", "/xproxy") |
|
|
loadProxy("/etc/xproxy/config", "/xproxy") |
|
|
|
|
|
|
|
|
//content, err := os.ReadFile("test.yml")
|
|
|
|
|
|
//if err != nil {
|
|
|
|
|
|
// panic(err)
|
|
|
|
|
|
//}
|
|
|
|
|
|
//loadConfig(content)
|
|
|
|
|
|
} |
|
|
} |
|
|