Skip to content

Commit

Permalink
bump relay
Browse files Browse the repository at this point in the history
  • Loading branch information
navigaid committed May 11, 2024
1 parent 979234e commit b34131e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
10 changes: 3 additions & 7 deletions apps/mini/mini.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,11 @@ func listenHTTP(handler http.Handler) error {

func Run([]string) (err error) {
store := relay.NewSessionStore()
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),
),
)
store.Use(utils.GinLoggerMiddleware)
store.Use(AltSvcMiddleware)
}
s := relay.NewWSServer(envs.HOST, store)

extra := os.Getenv("EXTRA")
if extra != "" {
Expand Down
20 changes: 7 additions & 13 deletions apps/relay/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log/slog"
"net"
"net/http"
"os"

"github.com/caddyserver/certmagic"
"github.com/webteleport/relay"
Expand Down Expand Up @@ -113,21 +114,14 @@ func Run([]string) (err error) {
}

store := relay.NewSessionStore()
s := relay.NewWSServer(envs.HOST, store).
WithPostUpgrade(
utils.GinLoggerMiddleware(
// Set the Alt-Svc header for UDP port discovery && http3 bootstrapping
AltSvcMiddleware(store),
),
)
if os.Getenv("LOGGIN") != "" {
store.Use(utils.GinLoggerMiddleware)
store.Use(AltSvcMiddleware)
}
s := relay.NewWSServer(envs.HOST, store)
t := relay.NewWTServer(envs.HOST, store).
WithAddr(envs.UDP_PORT).
WithTLSConfig(GlobalTLSConfig).
WithPostUpgrade(
utils.GinLoggerMiddleware(
store,
),
)
WithTLSConfig(GlobalTLSConfig)

return listenAll(s, t, GlobalTLSConfig)
}
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
github.com/vmware-labs/wasm-workers-server v1.7.0
// github.com/webteleport/caddy-webteleport v0.0.1
github.com/webteleport/auth v0.0.8
github.com/webteleport/relay v0.4.24
github.com/webteleport/relay v0.4.25
github.com/webteleport/utils v0.2.15
github.com/webteleport/webteleport v0.5.28
github.com/webteleport/wtf v0.1.22
Expand Down Expand Up @@ -65,6 +65,7 @@ require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/briandowns/spinner v1.23.0 // indirect
github.com/btwiuse/connect v0.0.5 // indirect
github.com/btwiuse/muxr v0.0.1 // indirect
github.com/btwiuse/wsconn v0.0.2 // indirect
github.com/bufbuild/protocompile v0.8.0 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
Expand Down

0 comments on commit b34131e

Please sign in to comment.