Recently, I deployed Licode on one of the productions servers at my company
where I am interning. As with most such servers, most of the ports were
blocked and the handful of the ones that were open weren’t the ones that
Licode uses by default. So I went through the code to figure out the places
where this change needed to be made to use the ports that were open. Then I
figured, it would be better if I can change them dynamically and this is my
solution for that. I added these elements in the config object of
’licode_config.js’:
config.httpServerPort = 8101;
config.erizoControllerPort = 1936;
config.nuvePort = 1935;
You can change these ports as required. These are the files that need to be
changed that reflect these new ports now:
- Erizo Controller Port
- In the file,
licode/erizo_controller/erizoController/erizoController.js- Add this line: var config = require(’./…/…/licode_config’);
- Change line 13 to server.listen(config.erizoControllerPort);
- In the file, licode/nuve/nuveAPI/resource/tokensResource.js
- Add the line: var config =
require(’./…/…/…/licode_config.js’); - Change line 118 to: token.host = ec.ip + ‘:’ +
config.erizoControllerPort;
- Add the line: var config =
- Nuve Port
- In the file licode/nuve/nuveAPI/nuve.js
- Add this line, var config = require(’./…/…/licode_config.js’);
- Change line 70 to: app.listen(config.nuvePort);
- HttpServerPort
- In the file, licode/extras/basic_example/basicServer.js or similar
- Change line 41 to: N.API.init(config.nuve.superserviceID,
config.nuve.superserviceKey, ‘http://localhost:’ + config.nuvePort + ‘/’); - Change line 89 to: httpServer.listen(config.httpServerPort);
- Change line 41 to: N.API.init(config.nuve.superserviceID,
- In the file,
You will be able to access this code at localhost:<config.httpServerPort>.
This setup is working fine for me. Hope this works well enough for others
too. Leave your feedback here in a reply.