展示如何編寫簡單 WebSocket 服務器應用程序。
This Echo Server shows how to create a simple server application that sends back a reply in response to a message it receives, using the WebSocket API. For the sake of illustration, the reply is simply a copy of the message.
若 Web 瀏覽器支持
WebSocket
,還能用它打開
echoserver/echoclient.html
{echoclient.html} file, and operate as shown in the following screenshot:
否則,使用 WebSocket 迴顯客戶端 連接到服務器。
另請參閱 WebSocket 迴顯客戶端 .