goupnp/cmd/example_httpu_serving/example_httpu_serving.go

21 lines
414 B
Go
Raw Normal View History

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