194 Commits

Author SHA1 Message Date
Fedor Indutny
a487dc9b58 lib: allow overriding maxSockets 2012-10-26 01:39:13 +04:00
Fedor Indutny
5df6e7bdb8 http-proxy: emit websocket:start
* routing-proxy: allow listening for websocket:* event
2012-10-23 23:54:23 +04:00
Maciej Małecki
eafdc744b6 [refactor] Pass all options to Agent constructor 2012-09-27 10:00:10 +02:00
Bradley Meck
698b01da8e [fix] spdy should look like https when forwarding (until we get a client) 2012-09-20 10:54:29 -05:00
Maciej Małecki
cee27feedd [minor doc] Correct comment 2012-08-10 21:45:30 +02:00
Maciej Małecki
812868ddfc [minor] Remove setEncoding on incoming socket
This isn't needed as we don't do any string operations and `setEncoding`
results in a higher memory usage and is slower.
2012-08-10 21:43:55 +02:00
Wesley Mason
89459bfd32 If supplied pass changeOrigin option through to HttpProxy instance if set in RoutingProxy 2012-07-25 14:17:48 +01:00
Bert Belder
24b84068ea Fix socket leaks when FIN packet isn't responded to 2012-07-24 23:05:04 +02:00
Maciej Małecki
0d00b06af3 [fix] destroy() websockets in case of an error
Not doing so caused websockets in `CLOSE_WAIT` to pile up and cause
proxy to exceed open file descriptor limit.
2012-07-24 16:30:51 +02:00
indexzero
36226daa2e [dist] Complete JSHint compliance except for too many var statements 2012-07-22 03:14:01 -04:00
indexzero
4999b20b84 Merge branch '0.8.2' 2012-07-22 02:49:43 -04:00
Charlie Robbins
02b914d609 Merge pull request #246 from tellnes/proxy-remove
Implement RoutingProxy.prototype.remove
2012-07-21 23:33:07 -07:00
Charlie Robbins
f28c62c815 Merge pull request #235 from Filirom1/patch-1
prefer `target.hostname` over `target.host`
2012-07-21 23:31:35 -07:00
Christian Howe
0273958b0a Use changeOrigin for proxyRequest. 2012-07-22 02:24:15 -04:00
Christian Howe
04ce49c5b2 Whitespace fixes. 2012-07-22 02:24:02 -04:00
indexzero
55286a7c49 [fix api] Optimize lookups in the ProxyTable. Ensure that RoutingProxy can proxy to https by default. 2012-07-22 01:02:51 -04:00
Ramprasad Rajendran
0933f1c598 Fix bug: x-forwarded-proto set incorrectly
When routed via multiple proxies, x_forwarded_proto set as httphttps or
wswss instead of http,https or ws,wss, since + operator seems to have a
higher precedence than the terniary operator and the expression was
getting evaluated to true always
2012-06-19 12:00:24 +05:30
Christian Howe
64c974755d Merge pull request #218 from CodeRarity/proxy-table-fix
Fix problem with req.url not being not properly replaced.
2012-06-05 13:04:18 -07:00
Ryan Stevens
ca37ad7436 [fix] x-forwarded-proto sets properly
The ternary was evaluating truthy for "," + req.connection.pair which is always true because its always a non empty string.  Wrapped actual condition to properly concatenate the product of the ternary.  let me know if you prefer the style   (req.connection.pair ? 'https' : 'http')

https://github.com/nodejitsu/node-http-proxy/issues/250
2012-05-22 12:54:47 -07:00
Christian Tellnes
0532995dfa Implement RoutingProxy.prototype.remove 2012-05-17 05:44:56 +02:00
Christian Howe
f223ce8b4e Merge pull request #216 from CodeRarity/master
Re-emit 'start', 'forward' and 'end' events in RoutingProxy, and fix some hanging issues.
2012-05-10 09:34:46 -07:00
Romain
c4d185dca9 prefer target.hostname over target.host 2012-04-24 10:22:56 +03:00
Christian Howe
b26b434e9f Fix RoutingProxy hanging when there is an error 2012-03-30 20:45:29 -04:00
Marco Palladino
4358a4c122 finally removed hidden char 2012-03-30 15:33:55 -07:00
Marco Palladino
5842d0ee7d syntax error fixed 2012-03-30 15:16:34 -07:00
Christian Howe
f1611ec8dc Fix problem with req.url not being not properly replaced. 2012-03-29 13:05:49 -04:00
Marak Squires
f20b3740b1 Merge branch 'master' of github.com:nodejitsu/node-http-proxy 2012-03-28 22:36:23 -07:00
Christian Howe
99ee54259e Re-emit 'start', 'forward' and 'end' events in RoutingProxy. 2012-03-27 21:38:35 -04:00
Christian Howe
e9fd3f43d7 Whitespace fixes 2012-03-27 21:36:36 -04:00
indexzero
c81bae2fdd [fix minor] Correctly set x-forwarded-proto in WebSocket requests 2011-12-23 01:40:35 -05:00
indexzero
6f8ad3b8c3 Merge branch '0.6-compatibility' 2011-12-23 01:34:02 -05:00
indexzero
3828616816 [refactor] Listen for socket events since reverseProxy.socket is no longer set synchronously 2011-12-23 01:33:24 -05:00
Maciej Małecki
4d43d81e5c [fix] When client request is aborted, abort server request 2011-12-18 22:49:18 +01:00
Maciej Małecki
63dfc7f175 [fix] In routing proxy, match line beginning
Previous approach failed in case of routing table like:

    {
      'domain.com': 'localhost:9000',
      'a.domain.com': 'localhost:9001'
    }

without `hostnameOnly`. When routing request to `a.domain.com`,
`RegExp` matched first entry (`domain.com`) and returned it.
2011-12-18 21:47:06 +01:00
Charlie Robbins
9f05e6c567 Merge pull request #165 from elfsternberg/master
Fix issue where front-end is HTTPS, back-end is HTTP, and server issues a redirect.
2011-12-13 22:21:51 -08:00
Charlie Robbins
d1b19a1205 Merge pull request #164 from elfsternberg/553e7fbc335a9befd166d472f057aa50452a9d40
Modified the ad-hoc proxy lookup to use _getKey(), rather than the error-prone in-line method.
2011-12-13 22:21:07 -08:00
indexzero
5b52c89694 [refactor] Updates to support http2 from @mikeal
Conflicts:

	lib/node-http-proxy/http-proxy.js
2011-12-14 01:45:52 +01:00
Maciej Małecki
86b4122323 [v0.6] http.Agent uses different structure for sockets 2011-12-14 01:45:44 +01:00
Maciej Małecki
6655e01642 [v0.6] Don't use agent.appendMessage()
Instead, just perform a request.
2011-12-14 01:45:34 +01:00
Marak Squires
f086692619 Merge branch 'master' of github.com:nodejitsu/node-http-proxy 2011-12-05 14:20:32 -08:00
Ken "Elf" Mathieu Sternberg
411bb51cc6 Fix issue where front-end is HTTPS, back-end is HTTP, and server issues a redirect.
This handles the case where a back-end web application such as Django or
Rails issues a redirect and automatically decorates the URL with the
protocol with which it was addressed.  If the back-ends are internal and
HTTP-only, then they'll issue a URL with 'http://' as the protocol.
This must be fixed before leaving the proxy.

This also handles the (unusual) case where a back-end speaks only
https://, but the user is deploying node-http-proxy to make that service
available to non-SSL capable browsers.  Works only with 301 and 302
codes.
2011-11-29 10:10:16 -08:00
Ken "Elf" Mathieu Sternberg
553e7fbc33 Modified the ad-hoc proxy lookup to use _getKey(), rather than the
error-prone in-line method.

_getKey() will look for options.target as well as
options.host:options.port, and so is useful for a segmented
proxy server where the destination proxies are not constructed before
first references.
2011-11-29 09:52:32 -08:00
Samyak Bhuta
621f9b425a Allowing the common proxy headers' value to be appended in proxy chain scenarios. 2011-11-28 08:56:45 +00:00
Charlie McConnell
3ab02f3ad7 [fix] Fix incorrect depth check. 2011-11-16 19:15:51 -08:00
Max Ogden
c03a450d9b simplify proxytable path segment rewrite logic 2011-11-16 19:15:51 -08:00
Cloud9
2061c71366 Revert "update outgoing.headers.host incase the destination does proxying"
This reverts commit 65b7872e6ad433deae4de823c63629cb341bd649.
2011-11-16 16:42:07 -08:00
Fabian Jakobs
d6ea3a425c don't add upgrade handler if a custom handler is passed in
if a callback but no static proxy is defined and
no routes are provided then handlers.length is 1.
However the upgrade event is still automagically
attached in spite of having an explicit callback.
2011-11-16 16:40:51 -08:00
koichik
152d258ea0 [fix] Avoid Transfer-Encoding: chunked for HTTP/1.0 client, closes #59. 2011-11-16 16:10:00 -08:00
Marak Squires
6a9751eb0d Merge branch 'master' of github.com:nodejitsu/node-http-proxy 2011-11-16 15:19:01 -08:00
Camilo Aguilar
c98ccb40e9 Fixes memory leak when clients abort connections 2011-11-15 20:20:47 -05:00