forked from xjasonlyu/tun2socks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
43 lines (36 loc) · 705 Bytes
/
main.go
File metadata and controls
43 lines (36 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"os"
"time"
"github.com/urfave/cli/v2"
"github.com/xjasonlyu/tun2socks/internal/cmd"
"github.com/xjasonlyu/tun2socks/pkg/log"
)
const About = "A tun2socks powered by gVisor TCP/IP stack."
var (
Version string
BuildTime string
)
func main() {
app := &cli.App{
Usage: About,
Version: Version,
Action: cmd.Main,
Flags: []cli.Flag{
&cmd.API,
&cmd.Device,
&cmd.DNS,
&cmd.Hosts,
&cmd.Interface,
&cmd.LogLevel,
&cmd.Proxy,
&cmd.Version,
},
HideVersion: true,
HideHelpCommand: true,
}
app.Compiled, _ = time.Parse(time.RFC3339, BuildTime)
if err := app.Run(os.Args); err != nil {
log.Fatalf("Failed to start: %v", err)
}
}