I am creating a programmable video using Twilio Cloud Platform. Currently working locally.
I have created two clients(Peer-to-Peer communication) for the testing purpose, see the picture below.
When the button for joining the room is clicked for the first time ever by either client, I get the following error on the console:
index.js:141 WebSocket connection to 'wss://sdkgw.us1.twilio.com/v1/VideoEvents'
failed: WebSocket is closed before the connection is established.
websocket error
I have gone through this link but it solves the issue for an older version (1.5.x) and my version is 2.x. 
how can I fix this websocket error?