update sni handler

This commit is contained in:
ginuerzh
2022-04-14 14:53:13 +08:00
parent 7a334c173c
commit dca2a79c54
4 changed files with 102 additions and 84 deletions

View File

@ -84,7 +84,7 @@ func (h *httpHandler) Handle(ctx context.Context, conn net.Conn, opts ...handler
}
func (h *httpHandler) handleRequest(ctx context.Context, conn net.Conn, req *http.Request, log logger.Logger) error {
if h.md.sni && !req.URL.IsAbs() && govalidator.IsDNSName(req.Host) {
if !req.URL.IsAbs() && govalidator.IsDNSName(req.Host) {
req.URL.Scheme = "http"
}