Last active
August 29, 2015 14:08
-
-
Save mrajagopal/3f743ad0c75e5f212b45 to your computer and use it in GitHub Desktop.
URL parsing
This file contains 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
"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