feat(whip): wire WHIPHandler into HTTP server Config and v3 routes
This commit is contained in:
parent
a22b8c68f0
commit
1be78a8185
1 changed files with 15 additions and 3 deletions
|
|
@ -87,7 +87,8 @@ type Config struct {
|
||||||
Cors CorsConfig
|
Cors CorsConfig
|
||||||
RTMP rtmp.Server
|
RTMP rtmp.Server
|
||||||
SRT srt.Server
|
SRT srt.Server
|
||||||
WebRTC *appwebrtc.Handler
|
WebRTC *appwebrtc.Handler // WHEP egress handler
|
||||||
|
WHIP *appwebrtc.WHIPHandler // WHIP ingest handler
|
||||||
JWT jwt.JWT
|
JWT jwt.JWT
|
||||||
Config cfgstore.Store
|
Config cfgstore.Store
|
||||||
Cache cache.Cacher
|
Cache cache.Cacher
|
||||||
|
|
@ -126,7 +127,8 @@ type server struct {
|
||||||
session *api.SessionHandler
|
session *api.SessionHandler
|
||||||
widget *api.WidgetHandler
|
widget *api.WidgetHandler
|
||||||
resources *api.MetricsHandler
|
resources *api.MetricsHandler
|
||||||
webrtc *appwebrtc.Handler
|
webrtc *appwebrtc.Handler // WHEP egress
|
||||||
|
whip *appwebrtc.WHIPHandler // WHIP ingest
|
||||||
}
|
}
|
||||||
|
|
||||||
middleware struct {
|
middleware struct {
|
||||||
|
|
@ -245,6 +247,10 @@ func NewServer(config Config) (Server, error) {
|
||||||
s.v3handler.webrtc = config.WebRTC
|
s.v3handler.webrtc = config.WebRTC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.WHIP != nil {
|
||||||
|
s.v3handler.whip = config.WHIP
|
||||||
|
}
|
||||||
|
|
||||||
if config.Prometheus != nil {
|
if config.Prometheus != nil {
|
||||||
s.handler.prometheus = handler.NewPrometheus(
|
s.handler.prometheus = handler.NewPrometheus(
|
||||||
config.Prometheus.HTTPHandler(),
|
config.Prometheus.HTTPHandler(),
|
||||||
|
|
@ -552,12 +558,18 @@ func (s *server) setRoutesV3(v3 *echo.Group) {
|
||||||
s.router.GET("/api/v3/widget/process/:id", s.v3handler.widget.Get)
|
s.router.GET("/api/v3/widget/process/:id", s.v3handler.widget.Get)
|
||||||
}
|
}
|
||||||
|
|
||||||
// v3 WebRTC (WHEP egress). Mounted on the v3 group so JWT auth
|
// v3 WebRTC WHEP egress. Mounted on the v3 group so JWT auth
|
||||||
// covers it in M2; public embed tokens will ship in M3.
|
// covers it in M2; public embed tokens will ship in M3.
|
||||||
if s.v3handler.webrtc != nil {
|
if s.v3handler.webrtc != nil {
|
||||||
s.v3handler.webrtc.Register(v3)
|
s.v3handler.webrtc.Register(v3)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// v3 WebRTC WHIP ingest. Mounted alongside WHEP on the same v3
|
||||||
|
// group — both share JWT auth and live under /api/v3/whip/*.
|
||||||
|
if s.v3handler.whip != nil {
|
||||||
|
s.v3handler.whip.Register(v3)
|
||||||
|
}
|
||||||
|
|
||||||
// v3 Restreamer
|
// v3 Restreamer
|
||||||
if s.v3handler.restream != nil {
|
if s.v3handler.restream != nil {
|
||||||
v3.GET("/skills", s.v3handler.restream.Skills)
|
v3.GET("/skills", s.v3handler.restream.Skills)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue