fixing core.websocket to handle weird node.js implementation