change SNI obfuscation

This commit is contained in:
rui.zheng
2017-10-29 20:12:25 +08:00
parent 4599d81cc6
commit 7cbfd5f4ee
4 changed files with 40 additions and 24 deletions
+3 -6
View File
@@ -135,12 +135,9 @@ func (h *httpHandler) Handle(conn net.Conn) {
}
// try to get the actual host.
if req.Host != "" {
if index := strings.IndexByte(req.Host, '.'); index > 0 {
// try to decode the prefix
if name, err := decodeServerName(req.Host[:index]); err == nil {
req.Host = name
}
if v := req.Header.Get("Gost-Target"); v != "" {
if host, err := decodeServerName(v); err == nil {
req.Host = host
}
}