be consice

This commit is contained in:
Jeff Becker 2018-09-01 07:52:40 -04:00
parent 85e6297f4c
commit e735fb89e4
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 7 additions and 7 deletions

14
main.go
View File

@ -18,15 +18,15 @@ func main() {
} }
var onion, i2p proxy.Dialer var onion, i2p proxy.Dialer
var err error var err error
onion, err = proxy.SOCKS5("tcp", os.Args[2], nil, nil) onion, err = proxy.SOCKS5("tcp", args[1], nil, nil)
if err != nil { if err != nil {
fmt.Printf("failed to create onion proxy to %s, %s\n", os.Args[2], err.Error()) fmt.Printf("failed to create onion proxy to %s, %s\n", args[1], err.Error())
return return
} }
if len(args) > 2 { if len(args) > 2 {
i2p, err = proxy.SOCKS5("tcp", os.Args[3], nil, nil) i2p, err = proxy.SOCKS5("tcp", args[2], nil, nil)
if err != nil { if err != nil {
fmt.Printf("failed to create i2p proxy to %s, %s\n", os.Args[3], err.Error()) fmt.Printf("failed to create i2p proxy to %s, %s\n", args[2], err.Error())
return return
} }
} }
@ -54,11 +54,11 @@ func main() {
return return
} }
l, err := net.Listen("tcp", os.Args[1]) l, err := net.Listen("tcp", args[0])
if err != nil { if err != nil {
fmt.Printf("failed to listen on %s, %s\n", os.Args[1], err.Error()) fmt.Printf("failed to listen on %s, %s\n", args[0], err.Error())
return return
} }
fmt.Printf("proxy serving on %s\n", os.Args[1]) fmt.Printf("proxy serving on %s\n", args[0])
serv.Serve(l) serv.Serve(l)
} }