Browse files

improved logging and adding websocket config

  • Loading branch information...
1 parent 54cd3b7 commit e1b48da5fee0ad8a8b710963bd684381dfe8b298 @julien51 julien51 committed Mar 21, 2012
Showing with 9 additions and 0 deletions.
  1. +5 −0 config.default.js
  2. +3 −0 modules/websocket.js
  3. +1 −0 xmpp-server.js
View
5 config.default.js
@@ -9,4 +9,9 @@ module.exports = {
// keyPath: '/etc/xmpp-server/tls/localhost-key.pem',
// certPath: '/etc/xmpp-server/tls/localhost-cert.pem'
//},
+
+ // Listen on websockets
+ websocket: {
+ port: 5280
+ }
};
View
3 modules/websocket.js
@@ -14,6 +14,7 @@ function WebsocketWrapper(ws) {
var self = this;
this.ws = ws;
this.writable = true;
+ this.remoteAddress = ws.socket.remoteAddress;
this.ws.on('message', function(message) {
if (message.type === 'utf8') {
@@ -46,6 +47,8 @@ WebsocketWrapper.prototype.write = function(data) {
this.ws.sendUTF(data);
}
+
+
exports.configure = function(server, config) {
if(config) {
config.port = typeof(config.port) != 'undefined' ? config.port : 5280;
View
1 xmpp-server.js
@@ -16,6 +16,7 @@ config.cli({
port: ['port', ['p', "xmpp server port", 'number']],
config: ['c', "load config file", 'path', defaultConfigPath],
logger: ['logger', [false, "Log to stdout"]],
+ websocket: ['websocket', [false, "Do not listen on websocket connections"]],
});
config.load(function (args, opts) {

0 comments on commit e1b48da

Please sign in to comment.