Documentation ¶
Overview ¶
this version of pocket doesn't support connect proxy
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HOST = utils.EnvHost("")
View Source
var RelayHook = &hook.Handler[*core.ServeEvent]{ Func: func(se *core.ServeEvent) error { if HOST == "" { return se.Next() } log.Println("starting the relay server", "HOST", HOST) store := relay.NewSessionStore() if os.Getenv("LOGGIN") != "" { store.Use(utils.GinLoggerMiddleware) } mini := relay.NewWSServer(HOST, store) se.Router.BindFunc(func(re *core.RequestEvent) error { r := re.Event.Request isPocketbaseHost := mini.IsRootExternal(r) isAPI := strings.HasPrefix(r.URL.Path, "/api/") isUI := strings.HasPrefix(r.URL.Path, "/_/") isPocketbase := isPocketbaseHost && (isAPI || isUI) if os.Getenv("VERBOSE") != "" { log.Println(fmt.Sprintf("isPocketbase (%v) := isPocketbaseHost (%v) && (isAPI (%v) || isUI (%v))", isPocketbase, isPocketbaseHost, isAPI, isUI)) } if !isPocketbase { mini.ServeHTTP(re.Event.Response, re.Event.Request) return nil } return re.Next() }) return se.Next() }, Priority: -99999, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.