Expose as printer in mdns.

Add http handler.
This commit is contained in:
2020-09-19 00:16:58 +02:00
parent a33fdeb808
commit 206e60e400
4 changed files with 33 additions and 2 deletions

21
main.go
View File

@@ -3,11 +3,30 @@ package main
import (
"context"
"ippserver/packages/mdnsserver"
"net/http"
log "github.com/sirupsen/logrus"
)
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel() // cancel when we are finished consuming integers
mdnsserver.Run(ctx)
go mdnsserver.Run(ctx)
http.HandleFunc("/", handle)
log.Info("http server started on :1234")
err := http.ListenAndServe(":1234", nil)
if err != nil {
log.Fatal("ListenAndServe: " + err.Error())
}
}
func handle(w http.ResponseWriter, r *http.Request) {
log.Infoln("handle")
// Disable caching of this page
// Check if user is logged in, if not redirect to login page
}