From 60510df2893f80fb276923227b20928ebe3138c5 Mon Sep 17 00:00:00 2001 From: fangdingjun Date: Mon, 23 Jul 2018 16:49:46 +0800 Subject: [PATCH] add RemoteAddr and URL on Request --- conn.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conn.go b/conn.go index e439342..81385ad 100644 --- a/conn.go +++ b/conn.go @@ -317,6 +317,10 @@ func (c *Conn) serve(s *stream) { if handler == nil { handler = http.DefaultServeMux } + s.request.RemoteAddr = c.conn.RemoteAddr().String() + if s.request.URL == nil { + s.request.URL = &url.URL{} + } handler.ServeHTTP(s, s.request) s.Close() }