diff --git a/docs/docco.css b/docs/docco.css index 5aa0a8d..bd54134 100644 --- a/docs/docco.css +++ b/docs/docco.css @@ -15,12 +15,20 @@ a { p { margin: 0 0 15px 0; } -h1, h2, h3, h4, h5, h6 { - margin: 0px 0 15px 0; +h4, h5, h6 { + color: #333; + margin: 6px 0 6px 0; + font-size: 13px; } - h1 { - margin-top: 40px; + h2, h3 { + margin-bottom: 0; + color: #000; } + h1 { + margin-top: 40px; + margin-bottom: 15px; + color: #000; + } #container { position: relative; } @@ -115,7 +123,7 @@ table td { } pre, tt, code { font-size: 12px; line-height: 18px; - font-family: Monaco, Consolas, "Lucida Console", monospace; + font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; margin: 0; padding: 0; } diff --git a/docs/node-http-proxy.html b/docs/node-http-proxy.html index 1975f0b..9e5a61f 100644 --- a/docs/node-http-proxy.html +++ b/docs/node-http-proxy.html @@ -1,4 +1,4 @@ - node-http-proxy.js
Jump To …

node-http-proxy.js

/*
+      node-http-proxy.js           

node-http-proxy.js

/*
   node-http-proxy.js: http proxy for node.js
 
   Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Marak Squires, Fedor Indutny 
@@ -29,7 +29,7 @@
     https = require('https'),
     events = require('events'),
     ProxyTable = require('./proxy-table').ProxyTable,
-    maxSockets = 100;

Version 0.5.0

exports.version = [0, 5, 0];

function _getAgent (host, port, secure)

+ maxSockets = 100;

Version 0.5.3 // 5/17/2011

exports.version = [0, 5, 3];

function _getAgent (host, port, secure)

@host {string} Host of the agent to get

@@ -179,10 +179,11 @@ for managing the life-cycle of streaming reverse proxyied HTTP requests.

var HttpProxy = exports.HttpProxy = function (options) {
   events.EventEmitter.call(this);
   
-  var self     = this;
-  options      = options || {};
-  this.forward = options.forward;
-  this.https   = options.https;
+  var self          = this;
+  options           = options || {};
+  this.forward      = options.forward;
+  this.https        = options.https;
+  this.changeOrigin = options.changeOrigin || false;
   
   if (options.router) {
     this.proxyTable = new ProxyTable(options.router, options.silent, options.hostnameOnly);
@@ -389,7 +390,12 @@ For client set encoding

socket.setTimeout(0); socket.setNoDelay(true); if (keepAlive) { - socket.setKeepAlive(true, 0); + if (socket.setKeepAlive) { + socket.setKeepAlive(true, 0); + } + else if (socket.pair.cleartext.socket.setKeepAlive) { + socket.pair.cleartext.socket.setKeepAlive(true, 0); + } } else { socket.setEncoding('utf8'); @@ -437,9 +443,12 @@ For client set encoding

detach(); }); };

Client socket

  _socket(socket);
-  

Remote host address

  var agent      = _getAgent(options.host, options.port),
-      remoteHost = options.host + (options.port - 80 === 0 ? '' : ':' + options.port);

Change headers

  req.headers.host   = remoteHost;
-  req.headers.origin = 'http://' + options.host;
+  

Remote host address

  var protocolName = options.https || this.https ? 'https' : 'http',
+      agent        = _getAgent(options.host, options.port, options.https || this.https),
+      remoteHost   = options.host + (options.port - 80 === 0 ? '' : ':' + options.port);

Change headers

  if (this.changeOrigin) {
+    req.headers.host   = remoteHost;
+    req.headers.origin = protocolName + '://' + remoteHost;
+  }
   
   outgoing = {
     host: options.host,
diff --git a/docs/proxy-table.html b/docs/proxy-table.html
index 3246477..d033647 100644
--- a/docs/proxy-table.html
+++ b/docs/proxy-table.html
@@ -1,4 +1,4 @@
-      proxy-table.js           

proxy-table.js

/*
+      proxy-table.js           

proxy-table.js

/*
   node-http-proxy.js: Lookup table for proxy targets in node.js
 
   Copyright (c) 2010 Charlie Robbins