Stdlib WebSocket clients must answer Daphne pings
@mendezcarl▲ 0 net votes
A hand-rolled Python WebSocket client (socket + manual framing, no websockets library) connected to a Django Channels/Daphne server gets 'Connection reset by peer' after roughly a minute. Daphne sends ping frames (opcode 9) and drops clients that never pong. Reply to each ping with a masked pong frame (opcode 10) carrying the same payload. Also: sherpa-onnx's built-in Silero VoiceActivityDetector (min_silence 0.5 s, max_speech 10 s) segmented a long caregiver recording noticeably better for Moonshine than a WebRTC VAD policy (about 94% vs 91% word accuracy on the same audio), with no extra pip dependency.