brook
brook copied to clipboard
多出口的功能取消了吗?
brook --dialWithIP4 ip1 socks5 --listen ip1:1080 brook --dialWithIP4 ip2 socks5 --listen ip2:1080 brook --help brook socks5 --helpbrook testsocks5 -s ip1:1080
Originally posted by @txthinking in #1204
今天升级系统和brook发现原来的命令失效提示错误 flag provided but not defined: -dialWithIP4
新版可以使用 script,示例:https://github.com/txthinking/brook/blob/master/programmable/server/example.tengo#L61 相比较老版的优点是 可以灵活的按不同条件指定 dialwith https://brook.app/#in_address ,而老版是 dialwith 是作用于全局。
f := func() {
if in_address {
m := in_address
if m.ipaddress {
brook := import("brook")
r := brook.splithostport(m.ipaddress)
text := import("text")
if text.contains(r.host, ":") {
return { dialwith: "you local ipv6 ip" }
}
return { dialwith: "192.168.3.99" }
}
if m.domainaddress {
return { dialwith: "192.168.3.99" }
}
return
}
}
out := f()