Websocket not connecting

25 Jun 2018, 05:05

client

import * as Colyseus from "colyseus.js";

var host = (window.document.location.host || "localhost").replace(/:.*/, '');
var client = new Colyseus.Client('ws://' + host + ':2657');

server: https://github.com/gamestdio/colyseus-examples/blob/master/index.ts

Error ( using Chrome):

index.js:5 WebSocket connection to 'ws://localhost:2657/?colyseusid=Byj_N10bm' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
25 Jun 2018, 15:44

@drevantonder

Sorry for the confusion, colyseus-examples is binding the server on port 2567, and your client is trying to connect to 2657. I'll update the ports on the demonstration projects to avoid this confusion.

Cheers

26 Jun 2018, 01:03

@endel Thanks