Fix: should not trust address of http.Client (#1616)

This commit is contained in:
Kr328
2021-09-13 23:46:39 +08:00
committed by GitHub
parent d49b38b00f
commit beb88cc46f
2 changed files with 9 additions and 3 deletions

View File

@ -9,8 +9,8 @@ import (
)
// NewHTTP receive normal http request and return HTTPContext
func NewHTTP(target string, source net.Addr, conn net.Conn) *context.ConnContext {
metadata := parseSocksAddr(socks5.ParseAddr(target))
func NewHTTP(target socks5.Addr, source net.Addr, conn net.Conn) *context.ConnContext {
metadata := parseSocksAddr(target)
metadata.NetWork = C.TCP
metadata.Type = C.HTTP
if ip, port, err := parseAddr(source.String()); err == nil {