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:
+1
-1
@@ -58,7 +58,7 @@ func NewAPIKeyAuthMiddleware(provider auth.KeyProvider) *APIKeyAuthMiddleware {
|
||||
}
|
||||
|
||||
func (m *APIKeyAuthMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
|
||||
if r.URL != nil && r.URL.Path == "/rtc/validate" {
|
||||
if r.URL != nil && (r.URL.Path == "/rtc/validate" || r.URL.Path == "/rtc/v1/validate") {
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user