2014-06-07 22:40:07 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/huin/goupnp/httpu"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
srv := httpu.Server{
|
|
|
|
Addr: "239.255.255.250:1900",
|
2014-06-08 08:10:34 +00:00
|
|
|
Multicast: true,
|
2014-06-07 22:40:07 +00:00
|
|
|
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)
|
|
|
|
}),
|
|
|
|
}
|
2014-06-08 08:10:34 +00:00
|
|
|
err := srv.ListenAndServe()
|
2014-06-07 22:40:07 +00:00
|
|
|
log.Printf("Serving failed with error: %v", err)
|
|
|
|
}
|