Skip to content

Commit

Permalink
Merge pull request #46 from 5high/patch-1
Browse files Browse the repository at this point in the history
修复域名解析https下不显示404页面问题
  • Loading branch information
yisier authored Jan 11, 2023
2 parents ab81f5b + 9d3e926 commit d740a27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/proxy/https.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"net"
"net/http"
"net/url"
"path/filepath"
"sync"

"ehang.io/nps/lib/cache"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d740a27

Please sign in to comment.