Code Monkey home page Code Monkey logo

Comments (8)

endel avatar endel commented on May 16, 2024

Hi @ZeroHackeR,

I've never seen this error. Can you provide the version of node and operational system you're using? Thanks!

from colyseus.

Federkun avatar Federkun commented on May 16, 2024

Same problem. PORT=80 npm start works fine. With every other port it doesn't.
v. node: v8.1.4, running on docker (ubuntu).

from colyseus.

Federkun avatar Federkun commented on May 16, 2024

I didn't have anything running on port 80. That was the problem. If I start a webserver on port 80, I don't get any error when colyseus-examples is running on other ports.

from colyseus.

endel avatar endel commented on May 16, 2024

Oh, I see. Thanks @Federkun!

@ZeroHackeR probably has the PORT environment variable set to 80 for some reason. Using any other (unused) port should be fine!

I've just updated the examples to use a fixed port number instead of prioritizing process.env.PORT.

from colyseus.

Federkun avatar Federkun commented on May 16, 2024

Mh, I don't think that's the case. I'm trying to understand why colyseus require an unrelated process running on port 80 to work correctly, but the error message doesn't offer any meaningful information..

from colyseus.

endel avatar endel commented on May 16, 2024

@Federkun Colyseus spawns a match-making process for internal communication only, I'm not sure if this line could be causing the problem: https://github.com/gamestdio/colyseus/blob/c59901e637fc7538f3ea4267a81360c26300e2ee/src/matchmaking/Process.ts#L13

from colyseus.

Federkun avatar Federkun commented on May 16, 2024

After some debugging I'm sure that the problem is here:
https://github.com/gamestdio/colyseus/blob/3f0a1ee8ee1d03a9c59459d5348c7c3d58e139e0/src/cluster/Worker.ts#L89
ClientRequest uses the default port (80) instead of the ephemeral port that's been used here:
https://github.com/gamestdio/colyseus/blob/765401e9acab6c09d92a01cea2eeeefc93214110/src/ClusterServer.ts#L112

I'm not sure about the api of ClientRequest, but if we can change the port to server.address().port, it should fix the problem. If I can find how to do it, I'll apply a patch today.

from colyseus.

Federkun avatar Federkun commented on May 16, 2024

I had to dig the nodejs repository to learn how to do it. I'll do a pull request in a second, so you can review it.

from colyseus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.