func main() { listen = flag.String("listen", "127.0.0.1:4443", "Listen on this address.") redis = flag.String("redis", "127.0.0.1:6379", "Redis server host:port.") drops = flag.String( "drops", "/dev/stderr", "File to write dropped packets in when redis is down.", ) flag.Parse() key = flag.Arg(0) if key == "" { fmt.Println("Please pass key as argument.") return } conn, err := net.ListenPacket("udp4", *listen) if err != nil { fmt.Println(err) return } rconn, err := net.Dial("tcp4", *redis) rconn = rconn if err != nil { fmt.Println(err) return } go RedisWriter(rconn) go UDPReader(conn) gutils.WaitForCtrlC() }
func main() { flag.Parse() pinger.SetupWorkers() pinger.SetupICMP4Server() pinger.SetupHTTPServer() pinger.SetupUDPServer() gutils.WaitForCtrlC() }
func main() { hostport := flag.String("http", ":3354", "HTTP Server, can also be 'none'.") flag.Parse() for _, arg := range flag.Args() { if err := CreateProxy(arg); err != nil { fmt.Println(err) } } if *hostport != "none" { fmt.Println("listening on", *hostport) go HttpServer(*hostport) } gutils.WaitForCtrlC() }