diff --git a/server/proxy/https.go b/server/proxy/https.go index 86e15687..596bf816 100644 --- a/server/proxy/https.go +++ b/server/proxy/https.go @@ -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)