flag 자체 구현

This commit is contained in:
2023-06-21 14:13:30 +09:00
parent 94b6d1499a
commit 0d8752e661
7 changed files with 197 additions and 27 deletions

View File

@ -21,6 +21,7 @@ import (
"syscall"
"time"
"repositories.action2quare.com/ayo/gocommon/flagx"
"repositories.action2quare.com/ayo/gocommon/logger"
"github.com/pires/go-proxyproto"
@ -84,6 +85,9 @@ func welcomeHandler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("welcome"))
}
var tls = flagx.String("tls", "", "")
var portptr = flagx.Int("port", 80, "")
// NewHTTPServer :
func NewHTTPServerWithPort(serveMux *http.ServeMux, port int) *Server {
if len(*tls) > 0 && port == 80 {