Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 82b0d1af1d3334fe515a33337133fd6c43cf404a @aroben committed Apr 16, 2012
Showing with 26 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 Procfile
  3. +17 −0 lowercaseme.js
  4. +7 −0 package.json
@@ -0,0 +1 @@
+node_modules
@@ -0,0 +1 @@
+web: node lowercaseme.js
@@ -0,0 +1,17 @@
+var HTTP = require('http')
+ , HTTPProxy = require('http-proxy')
+ , URL = require('url')
+ ;
+
+var proxy = new HTTPProxy.RoutingProxy();
+
+HTTP.createServer(function(request, response) {
+ var innerURL = request.url.substr(1);
+ var parsedURL = URL.parse(innerURL);
+ request.url = innerURL.toLowerCase();
+
+ proxy.proxyRequest(request, response, {
+ host: parsedURL.hostname,
+ port: 80,
+ });
+}).listen(8001);
@@ -0,0 +1,7 @@
+{
+ "name": "lowercaseme",
+ "version": "0.0.1",
+ "dependencies": {
+ "http-proxy": "0.8.0"
+ }
+}

0 comments on commit 82b0d1a

Please sign in to comment.