Merge pull request #46 from 5high/patch-1

修复域名解析https下不显示404页面问题
This commit is contained in:
yisier
2023-01-11 13:51:20 +08:00
committed by GitHub
+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)