diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_httpu_serving/example_httpu_serving.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_httpu_serving/example_httpu_serving.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_httpu_serving/example_httpu_serving.go b/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_httpu_serving/example_httpu_serving.go new file mode 100644 index 000000000..d9d9daa93 --- /dev/null +++ b/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_httpu_serving/example_httpu_serving.go @@ -0,0 +1,20 @@ +package main + +import ( + "log" + "net/http" + + "github.com/huin/goupnp/httpu" +) + +func main() { + srv := httpu.Server{ + Addr: "239.255.255.250:1900", + Multicast: true, + Handler: httpu.HandlerFunc(func(r *http.Request) { + log.Printf("Got %s %s message from %v: %v", r.Method, r.URL.Path, r.RemoteAddr, r.Header) + }), + } + err := srv.ListenAndServe() + log.Printf("Serving failed with error: %v", err) +} |