Create Websocket Connection In Javascript Object