Merge branch 'master' of https://github.com/esrrhs/pingtunnel
This commit is contained in:
commit
8dddc24f69
11
cmd/main.go
11
cmd/main.go
@ -39,6 +39,9 @@ Usage:
|
||||
|
||||
-catch 主动抓模式,每秒从服务器主动抓多少个reply包,默认0
|
||||
Active capture mode, how many reply packets are actively captured from the server per second, default 0
|
||||
|
||||
-key 设置的密码,默认0
|
||||
Set password, default 0
|
||||
`
|
||||
|
||||
func main() {
|
||||
@ -50,7 +53,8 @@ func main() {
|
||||
timeout := flag.Int("timeout", 60, "conn timeout")
|
||||
sproto := flag.Int("sproto", 8, "send ping proto")
|
||||
rproto := flag.Int("rproto", 0, "recv ping proto")
|
||||
catch := flag.Int("catch", 0, "catch mdoe")
|
||||
catch := flag.Int("catch", 0, "catch mode")
|
||||
key := flag.Int("key", 0, "key")
|
||||
flag.Usage = func() {
|
||||
fmt.Printf(usage)
|
||||
}
|
||||
@ -63,9 +67,10 @@ func main() {
|
||||
}
|
||||
|
||||
fmt.Println("start...")
|
||||
fmt.Printf("key %d\n", *key)
|
||||
|
||||
if *t == "server" {
|
||||
s, err := pingtunnel.NewServer(*timeout)
|
||||
s, err := pingtunnel.NewServer(*timeout, *key)
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR: %s\n", err.Error())
|
||||
return
|
||||
@ -80,7 +85,7 @@ func main() {
|
||||
fmt.Printf("server %s\n", *server)
|
||||
fmt.Printf("target %s\n", *target)
|
||||
|
||||
c, err := pingtunnel.NewClient(*listen, *server, *target, *timeout, *sproto, *rproto, *catch)
|
||||
c, err := pingtunnel.NewClient(*listen, *server, *target, *timeout, *sproto, *rproto, *catch, *key)
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR: %s\n", err.Error())
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user