fix http host
This commit is contained in:
parent
3b7d2614ed
commit
212412fe03
@ -132,7 +132,11 @@ func (h *httpHandler) Handle(conn net.Conn) {
|
|||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
|
||||||
cc, err := h.options.Chain.Dial(req.Host)
|
host := req.Host
|
||||||
|
if !strings.Contains(req.Host, ":") {
|
||||||
|
host += ":80"
|
||||||
|
}
|
||||||
|
cc, err := h.options.Chain.Dial(host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Logf("[http] %s -> %s : %s", conn.RemoteAddr(), req.Host, err)
|
log.Logf("[http] %s -> %s : %s", conn.RemoteAddr(), req.Host, err)
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -187,6 +188,9 @@ func (h *http2Handler) handleFunc(w http.ResponseWriter, r *http.Request) {
|
|||||||
if target == "" {
|
if target == "" {
|
||||||
target = r.Host
|
target = r.Host
|
||||||
}
|
}
|
||||||
|
if !strings.Contains(target, ":") {
|
||||||
|
target += ":80"
|
||||||
|
}
|
||||||
|
|
||||||
log.Logf("[http2] %s %s - %s %s", r.Method, r.RemoteAddr, target, r.Proto)
|
log.Logf("[http2] %s %s - %s %s", r.Method, r.RemoteAddr, target, r.Proto)
|
||||||
if Debug {
|
if Debug {
|
||||||
|
Loading…
Reference in New Issue
Block a user