Skip to content

Commit

Permalink
mini: add LOGGIN gate
Browse files Browse the repository at this point in the history
  • Loading branch information
navigaid committed Apr 18, 2024
1 parent 1e452e3 commit 71c2e6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/mini/mini.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"log/slog"
"net"
"net/http"
"os"

"github.com/webteleport/relay"
"github.com/webteleport/ufo/apps/relay/envs"
Expand All @@ -21,13 +22,15 @@ func listenHTTP(handler http.Handler) error {

func Run([]string) (err error) {
store := relay.NewSessionStore()
s := relay.NewWSServer(envs.HOST, store).
WithPostUpgrade(
s := relay.NewWSServer(envs.HOST, store)
if os.Getenv("LOGGIN") != "" {
s.WithPostUpgrade(
utils.GinLoggerMiddleware(
// Set the Alt-Svc header for UDP port discovery && http3 bootstrapping
AltSvcMiddleware(store),
),
)
}

return listenHTTP(s)
}
Expand Down

0 comments on commit 71c2e6b

Please sign in to comment.