From 080bd8241c4046dc6c8fb59fc92ccea33c482768 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Sun, 21 Apr 2024 19:43:27 +0000 Subject: [PATCH] Fix https://github.com/XTLS/Xray-core/issues/3288 --- transport/internet/reality/reality.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transport/internet/reality/reality.go b/transport/internet/reality/reality.go index 5548580c..0cc6950d 100644 --- a/transport/internet/reality/reality.go +++ b/transport/internet/reality/reality.go @@ -206,6 +206,9 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati req, _ = http.NewRequest("GET", string(prefix)+getPathLocked(paths), nil) maps.Unlock() } + if req == nil { + return + } req.Header.Set("User-Agent", fingerprint.Client) // TODO: User-Agent map if first && config.Show { newError(fmt.Sprintf("REALITY localAddr: %v\treq.UserAgent(): %v\n", localAddr, req.UserAgent())).WriteToLog(session.ExportIDToError(ctx))