Skip to content

Instantly share code, notes, and snippets.

@H7-25
Created May 31, 2014 20:23
Show Gist options
  • Save H7-25/2d5cf5e4e9a3fe3bca6e to your computer and use it in GitHub Desktop.
Save H7-25/2d5cf5e4e9a3fe3bca6e 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.request ?
event_data.connection.state.client.websocket.transport.request.headers.cookie || '' :
'';
console.log(cookies);
var cookie_val = cookies.match(/[ ;^]?cookie_name=([^;]+)/);
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