Connect to NodeJS Server
mwilki7 (277)

How do you get a client to connect to a nodejs server running on repl?
I'm attempting to make something along the lines of a simple chat room with (copied an example chat room app online that I will repurpose for a drawing/text multiplayer game). (Client)

Correct me if I'm misunderstanding this but,
I want the client to connect to the server (but I need to know the server's ip) so I do:

var ip = require("ip");
console.dir ( ip.address() );


Log it so I can paste that IP in the client's connect function call:

var socket = io.connect('');

But the client gets a timeout error and it seems that it can't connect to the server. I have verified that the server is running first.

Anyone know what I'm doing wrong?



This works with localhost in my Visual Studio project, any time I make a nodejs app for it just doesn't seem to work out.

You are viewing a single comment. View All
Answered by JustARatherRidi (190) [earned 5 cycles]
View Answer
mwilki7 (277)

Didn't seem to work. Console is logging connection timeout

console.dir is just something I got from