5 var env = require('gitter-web-env');
6 var nconf = env.config;
7 var faye = require('faye');
10 ['fatal', 'error', 'warn', 'info', 'debug'].forEach(function(level) {
11 faye.logger[level] = function(message) {
12 console.log('faye: ' + message);
16 var client = new faye.Client('https://ws.gitter.im/faye');
19 outgoing: function(message, callback) {
20 if (!message.ext) message.ext = {};
22 message.ext.password = nconf.get('ws:superClientPassword');
26 incoming: function(message, callback) {
31 var subscription = client.subscribe('/api/v1/user/5299eef6ed5ab0b3bf04d082', function(message) {
32 console.log('HELLO', message);
37 console.log('SUBSCRIBED');
40 console.log('FAILED ' + err);