brook icon indicating copy to clipboard operation
brook copied to clipboard

多出口的功能取消了吗?

Open m19921414377 opened this issue 6 months ago • 3 comments


brook --dialWithIP4 ip1 socks5 --listen ip1:1080

brook --dialWithIP4 ip2 socks5 --listen ip2:1080

brook --help

brook socks5 --help


brook testsocks5 -s ip1:1080

Originally posted by @txthinking in #1204

m19921414377 avatar Jun 12 '25 17:06 m19921414377

今天升级系统和brook发现原来的命令失效提示错误 flag provided but not defined: -dialWithIP4

m19921414377 avatar Jun 12 '25 17:06 m19921414377

新版可以使用 script,示例:https://github.com/txthinking/brook/blob/master/programmable/server/example.tengo#L61 相比较老版的优点是 可以灵活的按不同条件指定 dialwith https://brook.app/#in_address ,而老版是 dialwith 是作用于全局。

txthinking avatar Jun 13 '25 06:06 txthinking

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()

txthinking avatar Jun 15 '25 03:06 txthinking