I have a few questions about configuring socket.io for my node.js application.
-
When requiring
var socket = require('socket.io')( /* HERE */ )
, do I need to input the port my server listens where the/* HERE */
is at? -
Right below that line, I have another require, for a .js file that contains a few constants and a function. However when I try to refer to 'socket' in that file it says it's undefined? But since this line is below the require line for the socket.io middleware, why does it say 'undefined'?
-
For configuring client-side socket.io, I added this line:
var socket = io.connect('https://mydomain')
Do I need to say 'mydomain:port' or 'mydomain' is enough?
via konyv12
No comments:
Post a Comment