can we define two listening ports in a same server?

33 views
Skip to first unread message

nrza

unread,
Dec 24, 2014, 1:29:32 PM12/24/14
to eas...@googlegroups.com
Hi everyone,
I did coding to access the webcamera of my laptop. Then I separately created another project for chat. They both use different server codes(in node,js). Now i want to merge them together in a single code, But my server side code, when merged, is showing error . can any one help me with this ? below is my server side code for the merged project
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
var mongo=require('mongodb').MongoClient,
      client=require('socket.io').listen(8888).sockets;
 var static = require('node-static');
var http = require('http');
var file = new(static.Server)();
var app = http.createServer(function (req, res) {
  file.serve(req, res);
}).listen(8888);
........
FOLLOWED by other codes below...

thank you in advance

ROWLAND MWALE

unread,
Dec 27, 2014, 6:49:20 AM12/27/14
to eas...@googlegroups.com
Hi nrza..,
What error is your server throwing...? Is error generatd on server start up OR when the clients tries to connect.? More detail is required to help u.
Reply all
Reply to author
Forward
0 new messages