geckosio / geckos.io

🦎 Real-time client/server communication over UDP using WebRTC and Node.js http://geckos.io
BSD 3-Clause "New" or "Revised" License
1.35k stars 85 forks source link

Error connection aborted #208

Closed ghost closed 1 year ago

ghost commented 2 years ago

Hello, when I load my page, the client connect to 4 differents servers, do some checks, then disconnect from all the servers, and connect to a new server.

But some peoples actually facing this issue :

image

I don't know when it's happening, because it works perfectly fine for me, but don't work randomly for some peoples (if it don't work one time, it never work).

I'm actually using this server code :

import { createSecureServer } from "http2"

const options = {
    key: readFileSync(`path...`),
    cert: readFileSync(`path...`),
}

const HTTPServer = createSecureServer(options);

const server = geckos({
  authorization: async function (auth, request) {
      return {
          ip: request.socket.remoteAddress.replace("::ffff:", ""),
          type: auth,
      }
  },
  label: "wild.io",
  cors: { origin: "*", allowAuthorization: true }
});

server.addServer(HTTPServer)

HTTPServer.listen(8080, function() {
  console.log("Server successfully started !");
});

I'm using http2, but some peoples still get the same error, even when using express as on the https exemple

Any idea about how can I fix it ?

yandeu commented 2 years ago

Not sure.

But I highly recommend not using geckos just for simple checks. Please use normal http requests instead if possible.

ghost commented 2 years ago

Not sure.

But I highly recommend not using geckos just for simple checks. Please use normal http requests instead if possible.

I could do http requests to check player number, but it's too checking the latency. I don't think that an http request will give real results for this.

yandeu commented 2 years ago

Ooh yes. I see.

yandeu commented 2 years ago

Is there a way to reproduce the error locally?

ghost commented 2 years ago

Uhm I don't know, it never happen to me, and works for most of peoples. A minority of persons are getting this error (peoples are located all arround the world).

Some peoples are getting ERR:TIMEDOUT error instead of aborted

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 10 days with no activity.