Popularity
4.4
Stable
Activity
0.0
Stable
94
3
23
Programming language: Go
License: MIT License
XFF alternatives and similar packages
Based on the "Actual middlewares" category.
Alternatively, view XFF alternatives based on common mentions on social networks and blogs.
-
easy-middleware
easy-middleware is a lightweight json middleware stack for Go >= 1.7.
Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Promo
www.sonarqube.org
Do you think we are missing an alternative of XFF or a related project?
Popular Comparisons
README
X-Forwarded-For middleware fo Go

Package xff
is a net/http
middleware/handler to parse Forwarded HTTP Extension in Golang.
Example usage
Install xff
:
go get github.com/sebest/xff
Edit server.go
:
package main
import (
"net/http"
"github.com/sebest/xff"
)
func main() {
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("hello from " + r.RemoteAddr + "\n"))
})
xffmw, _ := xff.Default()
http.ListenAndServe(":8080", xffmw.Handler(handler))
}
Then run your server:
go run server.go
The server now runs on localhost:8080
:
$ curl -D - -H 'X-Forwarded-For: 42.42.42.42' http://localhost:8080/
HTTP/1.1 200 OK
Date: Fri, 20 Feb 2015 20:03:02 GMT
Content-Length: 29
Content-Type: text/plain; charset=utf-8
hello from 42.42.42.42:52661