The server is built with Nodejs, and the client is opened in Google Chrome using the file protocol, and the data can be successfully connected and returned.
世界只因有你2017-05-16 13:41:14
The browser does not require that the page and the URL of the wss connection have the same origin (if necessary, you can still check the Origin on the server and reject such a connection)
PHP中文网2017-05-16 13:41:14
It is true that Websocket is over HTTP, but it does not mean that it must be over HTTP for the page you get. When you open the file, js executes the connection and creates a new tcp connection for handshake.