I followed https://developer.playcanvas.com/en/tutorials/real-time-multiplayer/ tutorial and it works well when my node app is on Glich, but when I try to host it on my machine, it only works with 127.0.0.1:3000 IP, but not with the public IP. (and yes I opened my ports, firewall disabled)
I tested socket.io server with this tool: http://amritb.github.io/socketio-client-tool/
And everything works well, I get the connection on my machine.
Client side:
var Testbre = pc.createScript('testbre');
// initialize code called once per entity
Testbre.prototype.initialize = function() {
this.socket = io.connect('http://178.149.10.83:3000');
};
// update code called every frame
Testbre.prototype.update = function(dt) {
};
Server side:
var server = require('http').createServer();
var io = require('socket.io')(server);
io.sockets.on('connection', function(socket) {
console.log("Client has connected!");
});
console.log ('Server started.');
server.listen(3000, "0.0.0.0");