2014-06-07 22:40:07 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
|
2022-11-01 19:02:13 +00:00
|
|
|
"git.cyrilix.bzh/cyrilix/goupnp/httpu"
|
2014-06-07 22:40:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|