Comments (8)
Hi @ZeroHackeR,
I've never seen this error. Can you provide the version of node and operational system you're using? Thanks!
from colyseus.
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.
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.
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.
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.
@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.
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.
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)
- TypeError: roomHistory.clients is not iterable HOT 7
- [Bug]: Uncaught Error: ChangeTree: missing index for field "undefined"
- [Bug]: Map Schema Removing value creates issue HOT 2
- [Bug]: tsx must be loaded with --import instead of --loader HOT 3
- [Feature]: need Request in static onAuth HOT 6
- [Bug]: Cannot use Matchmaker w/o Server HOT 1
- [Bug]: Error code lost when throwing ServerError in onCreate HOT 2
- [Bug]: Cant join rooms from react typescript Application HOT 2
- [Feature]: UDP HOT 3
- [Bug]: States are not triggered in the expected order HOT 4
- [Bug]: clients and server both get stuck if the server threw an exception HOT 2
- [Bug]: When TypeScript target is "es2022", Server breaks HOT 3
- [Bug]: Module '"net"' has no exported member 'ServerOpts'. HOT 2
- Scalability and Content Security Policies inside Discord Activities (Discord Embedded SDK) HOT 1
- Server doesn't restart after 0.15 upgrade HOT 3
- Roadmap for @colyseus/schema 3.0 HOT 4
- [Feature]: Make Room have generic parameters for the UserData and AuthData (defaulting to any) HOT 1
- [Bug]: Matchmaker Player Stats can be inaccurate HOT 1
- [Bug]: Playground not working HOT 4
- [Bug]: Simultaneous joins fails due to halfway zombie seat reservation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colyseus.