@@ -54,6 +54,7 @@ func (m *testForwardPathManager) APIForwardDestGet(path string, id uuid.UUID) (*
5454
5555func TestForward (t * testing.T ) {
5656 rtmpID := uuid .New ()
57+ moqID := uuid .New ()
5758 whipID := uuid .New ()
5859 pathManager := & testForwardPathManager {
5960 items : map [uuid.UUID ]* defs.APIForwardDest {
@@ -67,9 +68,21 @@ func TestForward(t *testing.T) {
6768 LastError : "connection refused" ,
6869 OutboundBytes : 123 ,
6970 },
71+ moqID : {
72+ ID : moqID ,
73+ Pos : 2 ,
74+ Created : time .Date (2026 , 6 , 18 , 9 , 0 , 30 , 0 , time .UTC ),
75+ Conf : conf.ForwardDest {
76+ Dest : "moqt://localhost/live/stream" ,
77+ MoQTransport : conf .MoQTransportWebTransport ,
78+ },
79+ Protocol : defs .APIForwardDestProtocolMoQ ,
80+ State : defs .APIForwardDestStateForwarding ,
81+ OutboundBytes : 234 ,
82+ },
7083 whipID : {
7184 ID : whipID ,
72- Pos : 2 ,
85+ Pos : 3 ,
7386 Created : time .Date (2026 , 6 , 18 , 9 , 1 , 0 , 0 , time .UTC ),
7487 Conf : conf.ForwardDest {Dest : "whip://localhost/live/stream/whip" , WHIPBearerToken : "mytoken" },
7588 Protocol : defs .APIForwardDestProtocolWHIP ,
@@ -98,26 +111,45 @@ func TestForward(t *testing.T) {
98111 var list defs.APIForwardDestList
99112 httpRequest (t , hc , http .MethodGet ,
100113 "http://localhost:9997/v3/paths/forward/list?path=my%2Fnested%2Fstream" , nil , & list )
101- require .Equal (t , 2 , list .ItemCount )
114+ require .Equal (t , 3 , list .ItemCount )
102115 require .Equal (t , 1 , list .PageCount )
103- require .Len (t , list .Items , 2 )
116+ require .Len (t , list .Items , 3 )
104117
105118 require .ElementsMatch (t , []defs.APIForwardDest {
106119 {
107- ID : rtmpID ,
108- Pos : 1 ,
109- Created : time .Date (2026 , 6 , 18 , 9 , 0 , 0 , 0 , time .UTC ),
110- Conf : conf.ForwardDest {Dest : "rtmp://localhost/live/stream" },
120+ ID : rtmpID ,
121+ Pos : 1 ,
122+ Created : time .Date (2026 , 6 , 18 , 9 , 0 , 0 , 0 , time .UTC ),
123+ Conf : conf.ForwardDest {
124+ Dest : "rtmp://localhost/live/stream" ,
125+ MoQTransport : conf .MoQTransportQUIC ,
126+ },
111127 Protocol : defs .APIForwardDestProtocolRTMP ,
112128 State : defs .APIForwardDestStateError ,
113129 LastError : "connection refused" ,
114130 OutboundBytes : 123 ,
115131 },
116132 {
117- ID : whipID ,
118- Pos : 2 ,
119- Created : time .Date (2026 , 6 , 18 , 9 , 1 , 0 , 0 , time .UTC ),
120- Conf : conf.ForwardDest {Dest : "whip://localhost/live/stream/whip" , WHIPBearerToken : "mytoken" },
133+ ID : moqID ,
134+ Pos : 2 ,
135+ Created : time .Date (2026 , 6 , 18 , 9 , 0 , 30 , 0 , time .UTC ),
136+ Conf : conf.ForwardDest {
137+ Dest : "moqt://localhost/live/stream" ,
138+ MoQTransport : conf .MoQTransportWebTransport ,
139+ },
140+ Protocol : defs .APIForwardDestProtocolMoQ ,
141+ State : defs .APIForwardDestStateForwarding ,
142+ OutboundBytes : 234 ,
143+ },
144+ {
145+ ID : whipID ,
146+ Pos : 3 ,
147+ Created : time .Date (2026 , 6 , 18 , 9 , 1 , 0 , 0 , time .UTC ),
148+ Conf : conf.ForwardDest {
149+ Dest : "whip://localhost/live/stream/whip" ,
150+ WHIPBearerToken : "mytoken" ,
151+ MoQTransport : conf .MoQTransportQUIC ,
152+ },
121153 Protocol : defs .APIForwardDestProtocolWHIP ,
122154 State : defs .APIForwardDestStateForwarding ,
123155 OutboundBytes : 456 ,
@@ -126,10 +158,10 @@ func TestForward(t *testing.T) {
126158
127159 var item defs.APIForwardDest
128160 httpRequest (t , hc , http .MethodGet ,
129- "http://localhost:9997/v3/paths/forward/get?path=my%2Fnested%2Fstream&id=" + whipID .String (), nil , & item )
130- require .Equal (t , "whip ://localhost/live/stream/whip " , item .Conf .Dest )
131- require .Equal (t , "mytoken" , item .Conf .WHIPBearerToken )
132- require .Equal (t , defs .APIForwardDestProtocolWHIP , item .Protocol )
161+ "http://localhost:9997/v3/paths/forward/get?path=my%2Fnested%2Fstream&id=" + moqID .String (), nil , & item )
162+ require .Equal (t , "moqt ://localhost/live/stream" , item .Conf .Dest )
163+ require .Equal (t , conf . MoQTransportWebTransport , item .Conf .MoQTransport )
164+ require .Equal (t , defs .APIForwardDestProtocolMoQ , item .Protocol )
133165 require .Equal (t , defs .APIForwardDestStateForwarding , item .State )
134- require .Equal (t , uint64 (456 ), item .OutboundBytes )
166+ require .Equal (t , uint64 (234 ), item .OutboundBytes )
135167}
0 commit comments