How to use Colyseus without authentication?



I used the project below to try websocket with defold.

I run it on Defold Engine.
I started the server using “npm start”

And I go this error:

I need to send auth details to ws server?

– My goal is just to run a very simple websocket server with private-rooms.
I don’t need authentication atm. So, can skip JWT and rest of the stuffs.

Please help!



@endel, creator of Colyseus sometimes visits this forum, but your best bet for Colyseus support is in the official Colyseus forum:



Didn’t find any way to switch off authentication.
Also, thought of using same user/pass for all session, but then all will have same username.

Guess I need to keep looking at lua socket and modify python-websocket-server to create a room for each game.

I am only looking for a simple websocket-relay-server with private-rooms.
Player 1 will always be first node (room owner) and act as game-server.
Rest of the players join the room, and keep quite till their turn while receiving updates from game-server node.

Let me know if anyone has already done similar before.
Love to see beautiful codes.
I code old style.



Hi @James_0,

The example on the repository you’ve linked is a bit messy and “tests” a bunch of stuff without any particular order.

There are a few things to get rid of the authentication:

Hope this helps, if you have any further question feel free to join the Colyseus community either the forums or Discord. Cheers!



Thank you

saw this bit too late.
I already modified this python project

For whoever may need this simple approach:

clients = []

rooms = {}
class SimpleChat(WebSocket):

def handleMessage(self):
    if[0] == "/":
        if ([1:5] == "join"):
            messageSplit =" ")
            room_name = messageSplit[1]

            if room_name not in rooms:
                rooms[room_name] = []

            for client in rooms[room_name]:
                client.sendMessage( u'' + self.nickname +   ' joined the room.')                


        elif ([1:5] == "room"):
            print("room received")
            messageSplit ="/*^*/")
            room_name = messageSplit[0].split(":")
            room_name = room_name[1]
            message = messageSplit[1]
            if room_name not in rooms:
                self.sendMessage( u'' + 'Room does not exists.')
                for client in rooms[room_name]:
                    client.sendMessage( u'' + self.nickname +   ': ' + message)