2017-05-19 30 views

回答

1

the docs on MDN

// Create WebSocket connection. 
const socket = new WebSocket('ws://localhost:8080'); 

// Connection opened 
socket.addEventListener('open', function (event) { 
    socket.send('Hello Server!'); 
}); 
相關問題