Add support X-Forwarded-For
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func RemoteAddr(r *http.Request) string {
|
||||
if remote := r.Header.Get("X-Forwarded-For"); remote != "" {
|
||||
return remote + ", " + r.RemoteAddr
|
||||
}
|
||||
return r.RemoteAddr
|
||||
}
|
||||
Reference in New Issue
Block a user