From b553dd749baab4a86f49009ad09d4fc56f6125d8 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sun, 3 Apr 2022 19:15:16 +0800 Subject: [PATCH] refactor: Some adjustments --- adapter/provider/vehicle.go | 2 +- listener/tun/ipstack/gvisor/handler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adapter/provider/vehicle.go b/adapter/provider/vehicle.go index 31e5d6c0..eba8423c 100644 --- a/adapter/provider/vehicle.go +++ b/adapter/provider/vehicle.go @@ -58,7 +58,7 @@ func (h *HTTPVehicle) Read() ([]byte, error) { } req, err := http.NewRequest(http.MethodGet, uri.String(), nil) - req.Header.Set("user-agent", netHttp.UA) + req.Header.Set("User-Agent", netHttp.UA) if err != nil { return nil, err diff --git a/listener/tun/ipstack/gvisor/handler.go b/listener/tun/ipstack/gvisor/handler.go index 6365234e..78f456db 100644 --- a/listener/tun/ipstack/gvisor/handler.go +++ b/listener/tun/ipstack/gvisor/handler.go @@ -27,7 +27,7 @@ type GVHandler struct { func (gh *GVHandler) HandleTCP(tunConn adapter.TCPConn) { id := tunConn.ID() - rAddr := &net.UDPAddr{ + rAddr := &net.TCPAddr{ IP: net.IP(id.LocalAddress), Port: int(id.LocalPort), Zone: "",