diff --git a/component/simple-obfs/http.go b/component/simple-obfs/http.go index ab1b59b7..11894357 100644 --- a/component/simple-obfs/http.go +++ b/component/simple-obfs/http.go @@ -67,7 +67,10 @@ func (ho *HTTPObfs) Write(b []byte) (int, error) { req.Header.Set("User-Agent", fmt.Sprintf("curl/7.%d.%d", rand.Int()%54, rand.Int()%2)) req.Header.Set("Upgrade", "websocket") req.Header.Set("Connection", "Upgrade") - req.Host = fmt.Sprintf("%s:%s", ho.host, ho.port) + req.Host = ho.host + if ho.port != "80" { + req.Host = fmt.Sprintf("%s:%s", ho.host, ho.port) + } req.Header.Set("Sec-WebSocket-Key", base64.URLEncoding.EncodeToString(randBytes)) req.ContentLength = int64(len(b)) err := req.Write(ho.Conn)