How to use uWebSocketsTransport with colyseus
#895
-
|
Hey @endel, I am currently working on a project that uses colyseus, i came across this documentation for using uwebsocketsjs for production environments
I also noted one issue, when i passed the config object to Sample Code const config = {
gracefullyShutdown: true,
transport: new uWebSocketsTransport({
maxPayloadLength: 4096,
}),
};
console.log("transport -", config.transport); // exists
const gameServer = new Server(config);
console.log("transport -", config.transport); // undefined
gameServer.define('GameRoom', RoomInstance, {}); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @chiragpetals, since Colyseus You can access the express instance via: const app = config.transport['expressApp'];Beware that express v5 is not supported by the compatibility layer yet. I'm working to make the |
Beta Was this translation helpful? Give feedback.
Hi @chiragpetals, since Colyseus
0.16theuWebSocketsTransport()comes with uwebsockets-express compatibility layer built-in (see source-code).You can access the express instance via:
Beware that express v5 is not supported by the compatibility layer yet. I'm working to make the
uwebsockets-expresslayer compatible with express v5 at this exact moment (work in progress is onexpress-v5branch).