monitor 'connectionstatechange' event on transport on server side

This is how I achieved this:

As for how to restore rtc connection after it goes to ‘failure’ state:
You will have to manually close the transport and it’s producers and consumers and then create a new transport and producers and consumer on top of that to achieve reflow of streams.

Also read comments mentioned here: