MCPcopy
hub / github.com/txthinking/brook / main

Function main

cli/brook/main.go:51–2961  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49)
50
51func main() {
52 g := runnergroup.New()
53 df := func() {}
54 app := cli.NewApp()
55 app.Name = "Brook"
56 app.Version = "20260101"
57 app.Usage = "A cross-platform programmable network tool"
58 app.Authors = []*cli.Author{
59 {
60 Name: "Cloud",
61 Email: "cloud@txthinking.com",
62 },
63 }
64 app.Copyright = "https://github.com/txthinking/brook"
65 app.EnableBashCompletion = true
66 app.Flags = []cli.Flag{
67 &cli.StringFlag{
68 Name: "pprof",
69 Usage: "go http pprof listen addr, such as :6060",
70 },
71 &cli.StringFlag{
72 Name: "log",
73 Usage: "Enable log. A valid value is file path or 'console'. Send SIGUSR1 to me to reset the log file on unix system. If you want to debug SOCKS5 lib, set env SOCKS5_DEBUG=true",
74 },
75 &cli.StringSliceFlag{
76 Name: "tag",
77 Usage: "Tag can be used to the process, will be append into log or serverLog, such as: 'key1:value1'. All tags will also be appended as query parameters one by one to the userAPI",
78 },
79 &cli.StringFlag{
80 Name: "dialWithDNS",
81 Usage: "When a domain name needs to be resolved, use the specified DNS. Such as 8.8.8.8:53 or https://dns.google/dns-query?address=8.8.8.8%3A443, the address is required. Note that for client-side commands, this does not affect the client passing the domain address to the server",
82 },
83 &cli.StringFlag{
84 Name: "dialWithDNSPrefer",
85 Usage: "This is used with the dialWithDNS parameter. Prefer A record or AAAA record. Value is A or AAAA",
86 },
87 &cli.StringFlag{
88 Name: "dialWithIP4",
89 Usage: "When the current machine establishes a network connection to the outside IPv4, both TCP and UDP, it is used to specify the IPv4 used",
90 },
91 &cli.StringFlag{
92 Name: "dialWithIP6",
93 Usage: "When the current machine establishes a network connection to the outside IPv6, both TCP and UDP, it is used to specify the IPv6 used",
94 },
95 &cli.StringFlag{
96 Name: "dialWithNIC",
97 Usage: "When the current machine establishes a network connection to the outside, both TCP and UDP, it is used to specify the NIC used",
98 },
99 &cli.StringFlag{
100 Name: "dialWithSocks5",
101 Usage: "When the current machine establishes a network connection to the outside, both TCP and UDP, with your socks5 proxy, such as 127.0.0.1:1081",
102 },
103 &cli.StringFlag{
104 Name: "dialWithSocks5Username",
105 Usage: "If there is",
106 },
107 &cli.StringFlag{
108 Name: "dialWithSocks5Password",

Callers

nothing calls this directly

Calls 15

TouchBrookMethod · 0.95
ListenAndServeMethod · 0.95
ShutdownMethod · 0.95
ListenAndServeMethod · 0.95
ShutdownMethod · 0.95
ExchangeMethod · 0.95
NewPprofFunction · 0.92
NewLoggerFunction · 0.92
NewDialWithDNSFunction · 0.92
NewDialWithIPFunction · 0.92
NewDialWithNICFunction · 0.92
NewSocks5DialFunction · 0.92

Tested by

no test coverage detected