this.rpc = new WebsocketRpc(this.websocket);
// Clients address
- this.real_address = this.websocket.kiwi.real_address;
+ this.real_address = this.websocket.meta.real_address;
// A hash to identify this client instance
this.hash = crypto.createHash('sha256')
global.config.restrict_server_ssl :
command.ssl),
command.nick,
- {hostname: this.websocket.kiwi.revdns, address: this.websocket.kiwi.real_address},
+ {hostname: this.websocket.meta.revdns, address: this.websocket.meta.real_address},
options,
callback);
} else {
var WebListener = module.exports = function (web_config, transports) {
- var hs, opts, ws_opts,
+ var hs, opts,
that = this;
http_handler = new HttpHandler(web_config);
- // Standard options for the socket.io connections
- ws_opts = {
- 'log level': 0,
- 'log colors': 0
- };
-
-
if (web_config.ssl) {
opts = {
key: fs.readFileSync(web_config.ssl_key),
// Key/val data stored to the socket to be read later on
// May also be synced to a redis DB to lookup clients
- socket.kiwi = {};
+ socket.meta = {};
// If a forwarded-for header is found, switch the source address
if (request.headers[global.config.http_proxy_ip_header || 'x-forwarded-for']) {
address = request.headers[global.config.http_proxy_ip_header || 'x-forwarded-for'];
}
- socket.kiwi.real_address = address;
+ socket.meta.real_address = address;
// If enabled, don't go over the connection limit
if (global.config.max_client_conns && global.config.max_client_conns > 0) {
try {
dns.reverse(address, function (err, domains) {
if (err || domains.length === 0) {
- socket.kiwi.revdns = address;
+ socket.meta.revdns = address;
} else {
- socket.kiwi.revdns = _.first(domains) || address;
+ socket.meta.revdns = _.first(domains) || address;
}
// All is well, authorise the connection
callback(null, true);
});
} catch (err) {
- socket.kiwi.revdns = address;
+ socket.meta.revdns = address;
callback(null, true);
}
}