File: main.go

package info (click to toggle)
golang-github-sebest-xff 0.0~git20160910.6c115e0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 88 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 297 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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(":3000", xffmw.Handler(handler))
}