         }
                 
         self.roomId = roomId
-        socket = WebSocket(url: URL(string: serverUrl + roomId)!)
+        var url = serverUrl + roomId
+        if let queryParams = params {
+            if queryParams.count == 1{
+                let key = Array(queryParams.keys)[0]
+                url += "?" + key + "=" + queryParams[key]!
+            }else if queryParams.count > 1{
+                url += "?"
+                queryParams.forEach({ (key, val) in
+                    url += key + "=" + val + "&"
+                })
+                url = url.substring(to: url.index(before: url.endIndex))
+            }
+        }
+        socket = WebSocket(url: URL(string: url)!)
         if !RTCClientConfig.validateSsl{
             socket?.disableSSLCertValidation = true
         }

            
            if RTCClientConfig.audioOnly{
                delegate.rtcClientDidSetLocalMediaStream(client: self, authorized: true, audioOnly: RTCClientConfig.audioOnly)
                self.socketConnect(serverUrl: serverUrl, roomId: roomId)
            }else{
                
                let authStatus = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo)

                        localMediaStream?.addVideoTrack(localVideoTrack!)
                        
                        delegate.rtcClientDidSetLocalMediaStream(client: self, authorized: true, audioOnly: RTCClientConfig.audioOnly)
                        self.socketConnect(serverUrl: serverUrl, roomId: roomId, params: params)
                    }else{
                        print("RTCClient:Initialize:Camera unavailable on this device");
                        delegate.rtcClientDidSetLocalMediaStream(client: self, authorized: false, audioOnly: RTCClientConfig.audioOnly)
