Using net/http
Using http.DefaultServeMux
:
Using your own http.ServeMux
:
Use statsviz options API to serve Statsviz web UI on /foo/bar
(instead of default
/debug/statsviz
) and send metrics with a frequency of 250ms (rather than 1s):
Serve the the web UI via https
and Websocket via wss
:
Wrap statsviz handlers behind a middleware (HTTP Basic Authentication for example):
With gorilla/mux router:
Using valyala/fasthttp and soheilhy/cmux:
Using labstack/echo router:
With gin-gonic/gin web framework:
With go-chi/chi router:
With gofiber/fiber web framework:
With kataras/iris web framework: