func WithRedirectToHost(target string) Option {
	return func(o *options) {
		o.redirectToHost = target
	}
}
WithRedirectToHost redirects all requests to this host.
package web
import (
	"context"
	"fmt"
	"io/ioutil"
	"net"
	"net/http"
	"os"
	"path/filepath"
	"regexp"
	"strconv"
	"strings"
	"github.com/gorilla/csrf"
	"github.com/gorilla/mux"
	echo "github.com/labstack/echo/v4"
	echomiddleware "github.com/labstack/echo/v4/middleware"
	"go.thethings.network/lorawan-stack/v3/pkg/errors"
	"go.thethings.network/lorawan-stack/v3/pkg/fillcontext"
	"go.thethings.network/lorawan-stack/v3/pkg/log"
	"go.thethings.network/lorawan-stack/v3/pkg/random"
	"go.thethings.network/lorawan-stack/v3/pkg/webhandlers"
	"go.thethings.network/lorawan-stack/v3/pkg/webmiddleware"
	"go.thethings.network/lorawan-stack/v3/pkg/webui"
	"gopkg.in/yaml.v2"
)
type Registerer interface {
	RegisterRoutes(s *Server)
}
type Server struct {
	root *mux.Router
	router *mux.Router
	apiRouter *mux.Router
	echo *echo.Echo
}
type options struct {
	cookieHashKey  []byte
	cookieBlockKey []byte
	staticMount       string
	staticSearchPaths []string
	trustedProxies []string
	contextFillers []fillcontext.Filler
	redirectToHost  string
	redirectToHTTPS map[int]int
	logIgnorePaths []string
}
type Option func(*options)
func WithContextFiller(contextFillers ...fillcontext.Filler) Option {
	return func(o *options) {
		o.contextFillers = append(o.contextFillers, contextFillers...)
	}
}
func WithTrustedProxies(cidrs ...string) Option {
	return func(o *options) {
		o.trustedProxies = append(o.trustedProxies, cidrs...)
	}
}
func WithCookieKeys(hashKey, blockKey []byte) Option {
	return func(o *options) {
		o.cookieHashKey, o.cookieBlockKey = hashKey, blockKey
	}
}
func WithStatic(mount string, searchPaths ...string) Option {
	return func(o *options) {
		o.staticMount, o.staticSearchPaths = mount, searchPaths
	}
}