AlbianWarp / AlbianWarpServer

Albian Warp Server component!
https://blog.albianwarp.com
GNU General Public License v3.0
11 stars 1 forks source link

use native websocket ping frames rather than JSON ping #51

Open ligfx opened 3 years ago

ligfx commented 3 years ago

Code was sending a JSON message {"ping":"0123456789"} to test if the connection was still open — WebSocket has native support for this.

This is easier for clients as the native ping frames are usually handled automatically by the WebSocket library.

Note that gevent-websocket doesn't automatically send out ping frames to keep the connection alive, which servers are supposed to do. It might be worth switching to another WebSocket library in the future that is more compliant.