WebSocket protocol handler with pluggable I/O