V
V
Vasily Vorobyov2016-04-14 13:55:07
Django
Vasily Vorobyov, 2016-04-14 13:55:07

Why does socket.onmessage stop being called 2-3 minutes after new WebSocket()?

For the backend I use django-channels
js:

var socket = new WebSocket("ws://localhost:8000?session_key=...");
socket.onmessage = function() {
}

When the page is opened, onmessage works fine, but after a few minutes, messages from the client continue to arrive at the server, but messages from the server do not reach the client. Or they reach, but for some reason onmessage stops working.
What can be wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question