Make new path for signalling v1.5 support. (#4180)

* Make new path for signalling v1.5 support.

To be able to support newer clients to interact with older servers, move
signalling v1.5 to new path (`/rtc1`). On the new path, `join_request`
is required and single peer connection is used.

With the existing path `/rtc`, single peer connection is still supported
if `join_request` is used.

Newer clients connecting to old server should follow
1. Try new path WebSocket
2. If that fails, try new path validate at `/rtc1/validate`.
3. If the above gets a 404 which will happen with older server, revert
   back to old path and signalling 1.0.

Open to suggestions on path name.

* test on both paths

* change path from /rtc1 -> /rtc/v1

* test all rtc service path combinations
This commit is contained in:
Raja Subramanian
2025-12-20 01:02:22 +05:30
committed by GitHub
parent 32cd0370c7
commit cd99fec2e7
10 changed files with 249 additions and 160 deletions
+10 -10
View File
@@ -32,8 +32,8 @@ var (
)
func TestAgents(t *testing.T) {
for _, useSinglePeerConnection := range []bool{false, true} {
t.Run(fmt.Sprintf("singlePeerConnection=%+v", useSinglePeerConnection), func(t *testing.T) {
for _, testRTCServicePath := range testRTCServicePaths {
t.Run(fmt.Sprintf("testRTCServicePath=%s", testRTCServicePath.String()), func(t *testing.T) {
_, finish := setupSingleNodeTest("TestAgents")
defer finish()
@@ -70,8 +70,8 @@ func TestAgents(t *testing.T) {
return ""
}, RegisterTimeout)
c1 := createRTCClient("c1", defaultServerPort, useSinglePeerConnection, nil)
c2 := createRTCClient("c2", defaultServerPort, useSinglePeerConnection, nil)
c1 := createRTCClient("c1", defaultServerPort, testRTCServicePath, nil)
c2 := createRTCClient("c2", defaultServerPort, testRTCServicePath, nil)
waitUntilConnected(t, c1, c2)
// publish 2 tracks
@@ -126,8 +126,8 @@ func TestAgents(t *testing.T) {
}
func TestAgentNamespaces(t *testing.T) {
for _, useSinglePeerConnection := range []bool{false, true} {
t.Run(fmt.Sprintf("singlePeerConnection=%+v", useSinglePeerConnection), func(t *testing.T) {
for _, testRTCServicePath := range testRTCServicePaths {
t.Run(fmt.Sprintf("testRTCServicePath=%s", testRTCServicePath.String()), func(t *testing.T) {
_, finish := setupSingleNodeTest("TestAgentNamespaces")
defer finish()
@@ -158,7 +158,7 @@ func TestAgentNamespaces(t *testing.T) {
return ""
}, RegisterTimeout)
c1 := createRTCClient("c1", defaultServerPort, useSinglePeerConnection, nil)
c1 := createRTCClient("c1", defaultServerPort, testRTCServicePath, nil)
waitUntilConnected(t, c1)
testutils.WithTimeout(t, func() string {
@@ -188,8 +188,8 @@ func TestAgentNamespaces(t *testing.T) {
}
func TestAgentMultiNode(t *testing.T) {
for _, useSinglePeerConnection := range []bool{false, true} {
t.Run(fmt.Sprintf("singlePeerConnection=%+v", useSinglePeerConnection), func(t *testing.T) {
for _, testRTCServicePath := range testRTCServicePaths {
t.Run(fmt.Sprintf("testRTCServicePath=%s", testRTCServicePath.String()), func(t *testing.T) {
_, _, finish := setupMultiNodeTest("TestAgentMultiNode")
defer finish()
@@ -209,7 +209,7 @@ func TestAgentMultiNode(t *testing.T) {
return ""
}, RegisterTimeout)
c1 := createRTCClient("c1", secondServerPort, useSinglePeerConnection, nil) // Create a room on the second node
c1 := createRTCClient("c1", secondServerPort, testRTCServicePath, nil) // Create a room on the second node
waitUntilConnected(t, c1)
t1, err := c1.AddStaticTrack("audio/opus", "audio", "micro")