Created
May 31, 2014 20:23
-
-
Save H7-25/2d5cf5e4e9a3fe3bca6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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