OpenWebTorrent / openwebtorrent-tracker

Fast and simple Webtorrent tracker implementation in C++
https://openwebtorrent.com
71 stars 22 forks source link

Connections close after 1.7 minutes of stale activity #22

Open SnowyCoder opened 2 years ago

SnowyCoder commented 2 years ago

Hello,

I'm building a non-torrent open-source project using webtorrent trackers, I try to be as polite as possible (only one persistent connection is present, the other players disconnect once a webrtc connection is live), you can check it out here.

I found out that most webtorrent trackers close the connection after 1.7 minutes without data, even if the tracker requested an interval of 120 seconds (2m), I didn't see anything related in this code so I'm assuming it's external (nginx timeout or similar?). Is it an expected behaviour?

A workaround that I found is to send {"action":"scrape","info_hash":[]} as a "ping" message (unfortunately, browser js can't access websocket PINGs) but it seems not to work on openwebtorrent tracker (the connection gets forcibly closed, also not expected from the code).

Thanks for all of your work!

SnowyCoder commented 2 years ago

Also, seems related to: https://github.com/OpenWebTorrent/openwebtorrent-tracker/issues/14 (sorry for opening the issue on the wrong repo, I only found that after posting)