mitmedialab / django-channels-presence

"Rooms" and "Presence" for django-channels
MIT License
79 stars 38 forks source link

How do I remove invalid links when I cannot receive heartbeat packets? #20

Open CocoaML opened 3 years ago

CocoaML commented 3 years ago

How do I remove invalid links when I cannot receive heartbeat packets?

libs: daphne==3.0.2 Django==3.1.5 django-channels-presence==1.0.0 django-celery-beat==2.2.0

./manage.py prune_presence ./manage.py prune_room

The command can remove presence and remove room, but how can remove invalid links ? For example, a malicious program attack with invalid heartbeat.

CocoaML commented 3 years ago

How can I get help?

EDario333 commented 3 years ago

How can I get help?

Do you have an idea about how a program would attack with invalid heartbeat?

By the way, in order to spend less time, the command syntax is prune_presences and prune_rooms (plural, both):

./manage.py prune_presences ./manage.py prune_rooms

CocoaML commented 1 year ago

Thank you very much for your reply. @EDario333

About Heartbeats, This ./manage.py prune_presences and ./manage.py prune_rooms can remove connection rooms whose timestamps have expired, I don't see the relevant code logic about remove connections whose timestamps have expired.

and how can i remove connections whose timestamps have expired ?

How does the server actively disconnect the link whose timestamps have expired?Thanks.