|
|
@ -6,7 +6,10 @@ import (
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"io/ioutil"
|
|
|
|
"io/ioutil"
|
|
|
|
"net"
|
|
|
|
"net"
|
|
|
|
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"os/signal"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"syscall"
|
|
|
|
|
|
|
|
|
|
|
|
glog "github.com/fangdingjun/go-log"
|
|
|
|
glog "github.com/fangdingjun/go-log"
|
|
|
|
proxyproto "github.com/pires/go-proxyproto"
|
|
|
|
proxyproto "github.com/pires/go-proxyproto"
|
|
|
@ -202,5 +205,11 @@ func main() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}(l)
|
|
|
|
}(l)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
select {}
|
|
|
|
|
|
|
|
|
|
|
|
ch := make(chan os.Signal, 2)
|
|
|
|
|
|
|
|
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
|
|
|
|
|
|
|
|
select {
|
|
|
|
|
|
|
|
case s := <-ch:
|
|
|
|
|
|
|
|
glog.Printf("received signal %s, exit.", s)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|