While I have been searching for different alternatives to emit or broadcast with
socket.io [http://socket.io], the solution is quite simple. Use global variable
to access it.
Global variable
For example in my www (or server.js) file.
app.set('port', port)