websocket客户端与服务端数据传输 [removed] socket=newWebSocket('ws://127.0.0.1:8900','chat'); console.log(socket) socket.onopen=function(){ console.log('connectedsuccess'); socket.send('helloserver');//向服务器发消息 } socket.onmessage=function(e){ console.log(e.data);//接收服务器发来的消息 } [rem