Skip to content

Instantly share code, notes, and snippets.

@H7-25
Created September 20, 2014 13:37
Show Gist options
  • Select an option

  • Save H7-25/2fc4d8b0d5c64a6e73c4 to your computer and use it in GitHub Desktop.

Select an option

Save H7-25/2fc4d8b0d5c64a6e73c4 to your computer and use it in GitHub Desktop.
var kiwiModules = require('../server/modules');
var module = new kiwiModules.Module('Ident Cookie Module');
module.on('irc connecting', function(event, event_data) {
var cookies = event_data.connection.state.client.websocket.transport.req ?
event_data.connection.state.client.websocket.transport.req.headers.cookie || '' :
'';
//console.log(cookies);
var cookie_val = cookies.match(/[ ;^]?cookie_name=([^;]+)/);
//console.log(cookie_val);
if (cookie_val) {
event_data.connection.username = cookie_val[1];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment