Skip to content

Instantly share code, notes, and snippets.

@mrajagopal
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrajagopal/3f743ad0c75e5f212b45 to your computer and use it in GitHub Desktop.
Save mrajagopal/3f743ad0c75e5f212b45 to your computer and use it in GitHub Desktop.
URL parsing
"use strict";
var vsm = require('lrs/VirtualServerModule');
var urlm = require('url');
var cookie = require('cookie');
function onClientReq(servReq, servResp, next) {
var url = urlm.parse(servReq.url);
if (url.hostname == 'example.com')
{
console.log('accessing example.com');
}
next();
}
var onExists = function(vs){
fp.on('request', onClientReq);
}
vsm.on('exists', 'vs1', onExists);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment