Added a promise for web sockets