Change the javascript to support websocket