config for scheme and subrouter
This commit is contained in:
@@ -173,7 +173,7 @@ func main() {
|
||||
// ipv4 goroutines
|
||||
if rest.IPv4 != "" {
|
||||
listen := rest.IPv4 + ":" + strconv.Itoa(int(rest.Port))
|
||||
if strings.ToLower(rest.Schema) == "https" {
|
||||
if strings.ToLower(rest.Scheme) == "https" {
|
||||
go HttpListenTLS(listen, rest.CertFile, rest.KeyFile, router)
|
||||
} else {
|
||||
go HttpListen(listen, router)
|
||||
@@ -183,7 +183,7 @@ func main() {
|
||||
// ipv6 goroutines
|
||||
if rest.IPv6 != "" {
|
||||
listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))
|
||||
if strings.ToLower(rest.Schema) == "https" {
|
||||
if strings.ToLower(rest.Scheme) == "https" {
|
||||
go HttpListenTLS(listenv6, rest.CertFile, rest.KeyFile, router)
|
||||
} else {
|
||||
go HttpListen(listenv6, router)
|
||||
@@ -195,7 +195,7 @@ func main() {
|
||||
fs := http.FileServer(http.Dir(conf.WebServer.RootDir))
|
||||
http.Handle("/", fs)
|
||||
for _, listen := range conf.WebServer.Listen {
|
||||
if strings.ToLower(listen.Schema) == "https" {
|
||||
if strings.ToLower(listen.Scheme) == "https" {
|
||||
go HttpListenWebServerTLS(listen.Addr, listen.CertFile, listen.KeyFile)
|
||||
} else {
|
||||
go HttpListenWebServer(listen.Addr)
|
||||
|
||||
Reference in New Issue
Block a user