Closed draeder closed 3 years ago
I think I've answered my own question: browsers can only communicate with websockets servers for WebRTC signaling. So, the HTTP, HTTPS servers are accepting the torrent announcement, but the browser never hears back because the browser wants a websocket. This is why nothing else happens after announcement. Please correct me if I'm wrong...
@draeder yes that's correct, sorry I didn't get back to you in time. You're exactly right that webtorrent/bugout require a websocket connection. This is because the WebRTC handshake is two way (offer and answer) unlike traditional bittorrent where you can just find a peer and then connect directly to them using TCP/IP sockets. It's a fundamental limitation of WebRTC and browsers unfortunately.
Thanks for confirming and no worries about any delay in response. This is just a hobby for me after my day job... You might find this module useful for your webrtc-signaling-mesh project: https://www.npmjs.com/package/fake-bittorrent-client. I'm using this in mine, after just a basic host ping, to test the viability of trackers.
Is this expected if the trackers are not ws or wss?
I have been working on building an npm module that tests and returns working tracker servers listed on https://github.com/ngosang/trackerslist, specifically the lists for ws, wss, http, and https tracker servers. I also built my own tracker server that runs with wss, ws, https, and http.
In my testing with Bugout (in the browser: both using express, and straight html) to make sure my module is working correctly, I found that known good tracker servers that use http and https, including my own tracker server, do not work with Bugout. No error is returned; simply nothing happens.
One other thing I noticed is that the node version of Bugout code doesn't ever emit the "Low level WebTorrent events". Only the browser version of Bugout code does that (with or without ws/wss tracker servers).
The following is the extended Bugout logging for a browser example where I try to pass some known-good http/https tracker servers into Bugout. I wonder if this is some kind of CORS or HTTP header issue?
^^^ Nothing happens after this