d
This commit is contained in:
@@ -36,6 +36,7 @@ type YamlConfig struct {
|
|||||||
IPv6 string `yaml:"ipv6"`
|
IPv6 string `yaml:"ipv6"`
|
||||||
Port uint16 `yaml:"port"`
|
Port uint16 `yaml:"port"`
|
||||||
Schema string `yaml:"schema"`
|
Schema string `yaml:"schema"`
|
||||||
|
CaFile string `yaml:"caFile"`
|
||||||
CertFile string `yaml:"certFile"`
|
CertFile string `yaml:"certFile"`
|
||||||
KeyFile string `yaml:"keyFile"`
|
KeyFile string `yaml:"keyFile"`
|
||||||
} `yaml:"rest"`
|
} `yaml:"rest"`
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ func main() {
|
|||||||
if rest.IPv4 != "" {
|
if rest.IPv4 != "" {
|
||||||
listen := rest.IPv4 + ":" + strconv.Itoa(int(rest.Port))
|
listen := rest.IPv4 + ":" + strconv.Itoa(int(rest.Port))
|
||||||
if strings.ToLower(rest.Schema) == "https" {
|
if strings.ToLower(rest.Schema) == "https" {
|
||||||
go HttpListenTLS(listen, rest.CertFile, rest.KeyFile, router)
|
go HttpListenConfigTLS(listen, rest.CaFile, rest.CertFile, rest.KeyFile, router)
|
||||||
} else {
|
} else {
|
||||||
go HttpListen(listen, router)
|
go HttpListen(listen, router)
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,7 @@ func main() {
|
|||||||
if rest.IPv6 != "" {
|
if rest.IPv6 != "" {
|
||||||
listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))
|
listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))
|
||||||
if strings.ToLower(rest.Schema) == "https" {
|
if strings.ToLower(rest.Schema) == "https" {
|
||||||
go HttpListenTLS(listenv6, rest.CertFile, rest.KeyFile, router)
|
go HttpListenConfigTLS(listenv6, rest.CaFile, rest.CertFile, rest.KeyFile, router)
|
||||||
} else {
|
} else {
|
||||||
go HttpListen(listenv6, router)
|
go HttpListen(listenv6, router)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user