bugout
bugout copied to clipboard
Getting error connecting to tracker
If I try to use bugout
for either my own project or use one of the demos from the README provided, I get the following error in the browser console:
WebSocket connection to 'wss://hub.bugout.link/' failed: Error in connection establishment: net::ERR_CONNECTION_RESET
WebSocket connection to 'wss://tracker.btorrent.xyz/' failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID
WebSocket connection to 'wss://hub.bugout.link/' failed: Connection closed before receiving a handshake response
This was not happening before, and just saw this today when I got back to a project that I was working on The connection between two peers which was working before is not working anymore I tried on both Firefox as well as Chrome, the result is no different Also, I'm not running any ad-blocker or site-blocker I also tried it on two different networks, the problem persists
@tanayseven it appears the bugout webtorrent tracker server is overloaded. This is a problem with centralized tracker servers. It will take me a while to fix this. Does tracker.openwebtorrent.com still work for you?
See also #42.
How practical is it to use DHT instead of a tracker?
You can only use the DHT outside the browser. It works in nodejs.
Ouch!
@tanayseven if you want a temporary solution, spin up your own bittorrent-tracker instance and pass that to Bugout
.
That's what I was supposed to ask you. Can we pass any torrent trackers to Bugout
?
Yes for sure, you can use your own signaling server(s): https://github.com/chr15m/bugout/blob/master/docs/API.md#using-your-own-signaling-servers
Cool, thanks! Should I leave this issue open till you fix it?
It seems only trying to use another tracker like wss://tracker.openwebtorrent.com doesn't create a complete connection, but doesn't give any errors. But if I use on wss://hub.bugout.link, it'll create a connection between users and allow communication. Otherwise, it'll never complete the connection and no other users will enter the room. Since these seem to be the only running WebTorrent trackers, it's no wonder they're being hammered.
@phyreman I built a simple WebTorrent tracker server that can be deployed to Heroku with 1 click that you could use for your projects. You can also clone the repo and run it locally or anywhere else.
https://github.com/draeder/p2p-tracker
Hi @draeder - thank you for this! I just deployed the heroku server - but when I use it in the announce
option (as per the docs here), it never finds any peers. Is there something I'm missing?
Same here, it never finds any peers when using any of the trackers.
@tanayseven have you tried announcing to your own tracker server? Try the one I built: https://github.com/draeder/p2p-tracker. Simple 1-click deploy to Heroku, or you can clone and run it locally (but you'd want to set the port statically in server.js). I've never had issues with Bugout when I announce to my own tracker.
@tanayseven @hhff After doing the 1-click deploy to Heroku you should be able to connect as easily as the following: const bugout = new Bugout("SpaceTradersAPI-Chatroom", {announce: ["wss://spacetradersapi-chatbox.herokuapp.com"]});
I got it working pretty quick, but it does take a few seconds for Heroku to spin up your instance, so it'll take a bit for it to inform you of a connection. But after it get spun up, you shouldn't have any further delays. At least that's how it's been for me so far
Hi folks,
Yup, just confirming it's working for me too. Not sure why it was down originally, but happy to chalk it up to the magic of the internet!
h ᐧ
On Thu, Apr 8, 2021 at 12:30 PM John-Michael Glenn @.***> wrote:
@tanayseven https://github.com/tanayseven @hhff https://github.com/hhff After doing the 1-click deploy to Heroku you should be able to connect as easily as the following: const bugout = new Bugout("SpaceTradersAPI-Chatroom", {announce: ["wss:// spacetradersapi-chatbox.herokuapp.com"]}); I got it working pretty quick, but it does take a few seconds for Heroku to spin up your instance, so it'll take a bit for it to inform you of a connection. But after it get spun up, you shouldn't have any further delays. At least that's how it's been for me so far
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chr15m/bugout/issues/43#issuecomment-816097735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAV3R7CEB2NMOE6CSI2VKYDTHX74XANCNFSM4Y4HDQDQ .
-- Hugh Francis
c/o Sanctuary Computer, Inc 110 Bowery, 4th FL New York, NY 10013 sanctuary.computer https://www.sanctuary.computer
@draeder Oh yes, finally! It worked. I had tried it before and was not working. But, now it's working luckily! Thanks a lot for your help everyone!
@tanayseven Glad to hear it! Keep in mind if you're using it on Heroku and using the free tier, the app will sleep approximately 6 hours a day. You'd need to upgrade for it to run 24/7.
For the sake of context - it did not work for me immediately, even though I know the server was up (I was seeing peers connect in the Heroku logs). I came back to it the next day and it was working 👍
I am on hobby plan though fwiw!
It just stopped working now. It's hard to understand why it keeps stopping working every single time. I don't think there's any problem with the app running on Heroku, I get logs every time I try to connect with Bugout. Also, I've not even expired the free tier hours. It appears to randomly start working once in a while.
I tried it out, multiple times and realized that it takes quite a long time, roughly 5-10 minutes to get the peers connected.
I made a Glitch deployment option. The link is at https://github.com/hello-smile6/p2p-tracker .
@hello-smile6 thanks for the PR on p2p-tracker. The glitch option has been merged.
You're welcome.
@tanayseven Is this still a problem for you? I've been using a combination of my own tracker, and the Bugout supplied ones over the past couple of months without any issues.
@draeder , Hi I'm running your p2p tracker locally since I was getting failed connection errors to tracker.bttorrent.xyz and hub.bugout.link and I'm not sure if I'm using it correctly.
In the server side, my Bugout instance is:
const serverAddressText = document.querySelector("#server-address");
const b = new Bugout("DemoBugout",{
announce:["localhost:3001"]
});
console.log(b.address())
serverAddressText.innerText = `Bugout server address :${b.address()}`;
b.register("ping-server", function(address, args, callback) {
console.log(args.message)
args.message = "Hello from server: " + b.address();
callback(args);
});
Whereas the client-side code is:
const key = prompt("Enter server key")
const statusMessage = document.querySelector("#status-message");
var b = new Bugout(key,{
announce:["localhost:3001"]
});
b.on("server", function(address) {
statusMessage.innerText = `Connected to server with address ${key}`
console.log("connected to server")
b.rpc("ping-server", {"message": `Hello from client: ${b.address()}`}, function(result) {
console.log(result.message);
});
});
Is this the correct way of using the p2p tracker?
@draeder , Hi I'm running your p2p tracker locally since I was getting failed connection errors to tracker.bttorrent.xyz and hub.bugout.link and I'm not sure if I'm using it correctly.
In the server side, my Bugout instance is:
const serverAddressText = document.querySelector("#server-address"); const b = new Bugout("DemoBugout",{ announce:["localhost:3001"] }); console.log(b.address()) serverAddressText.innerText = `Bugout server address :${b.address()}`; b.register("ping-server", function(address, args, callback) { console.log(args.message) args.message = "Hello from server: " + b.address(); callback(args); });
Whereas the client-side code is:
const key = prompt("Enter server key") const statusMessage = document.querySelector("#status-message"); var b = new Bugout(key,{ announce:["localhost:3001"] }); b.on("server", function(address) { statusMessage.innerText = `Connected to server with address ${key}` console.log("connected to server") b.rpc("ping-server", {"message": `Hello from client: ${b.address()}`}, function(result) { console.log(result.message); }); });
Is this the correct way of using the p2p tracker?
Two issues, I think.
const key = prompt("Enter server key")
const statusMessage = document.querySelector("#status-message");
var b = new Bugout(key,{
announce:["ws://localhost:3001/"]
});
b.on("server", function(address) {
statusMessage.innerText = `Connected to server with address ${key}`
console.log("connected to server")
b.rpc("ping-server", {"message": `Hello from client: ${b.address()}`}, function(result) {
console.log(result.message);
});
});
const serverAddressText = document.querySelector("#server-address");
const b = new Bugout({
announce:["ws://localhost:3001/"]
});
console.log(b.address())
serverAddressText.innerText = `Bugout server address :${b.address()}`;
b.register("ping-server", function(address, args, callback) {
console.log(args.message)
args.message = "Hello from server: " + b.address();
callback(args);
});
You forgot to add the ws://
protocol string for the tracker URLs. Also, your server was trying to connect to a Bugout room, which could cause unpredictable behavior.
Hi @hello-smile6 , I tried adding the ws:// protocol to the tracker URLs and removed the Bugout room identifier from the server code but the connections still don't seem to work :(
Edit: Oops nevermind, I was using the wrong port. Its working now.
Thanks!
wss://tracker.bttorrent.xyz
has been flakey lately.
wss://tracker.bttorrent.xyz
has been flakey lately.
Can verify. Could someone create a WebTorrent tracker framework that uses Bugout to send data between servers? If someone does, I'll deploy several instances on Replit with a load balancer that relays each connection to a random server.