Update https.go

This commit is contained in:
5high
2023-01-11 10:08:42 +08:00
committed by GitHub
parent ab81f5b68e
commit 9d3e926256
+5
View File
@@ -4,6 +4,7 @@ import (
"net"
"net/http"
"net/url"
"path/filepath"
"sync"
"ehang.io/nps/lib/cache"
@@ -34,6 +35,10 @@ func NewHttpsServer(l net.Listener, bridge NetBridge, useCache bool, cacheLen in
//start https server
func (https *HttpsServer) Start() error {
var err error
if https.errorContent, err = common.ReadAllFromFile(filepath.Join(common.GetRunPath(), "web", "static", "page", "error.html")); err != nil {
https.errorContent = []byte("nps 404")
}
if b, err := beego.AppConfig.Bool("https_just_proxy"); err == nil && b {
conn.Accept(https.listener, func(c net.Conn) {
https.handleHttps(c)