1137 Commits

Author SHA1 Message Date
Jarrett Cruger
d0f1dfeb82 [fix] style nits 2016-10-22 11:45:16 -04:00
François Leurent
220f5fb795 Expose full callback names 2016-10-22 11:45:16 -04:00
François Leurent
d48f67eb90 Do not rely on func.name (no scope) 2016-10-22 11:45:16 -04:00
François Leurent
61c2889109 Do not rely on func.name (no scope) 2016-10-22 11:45:16 -04:00
François Leurent
fbc266809c With a comment 2016-10-22 11:45:16 -04:00
François Leurent
8eddf45f2a Fix browserification
Browserify fails to resolve the "./http-proxy/" as "./http-proxy/index.js" but as "./http-proxy.js" (so nothing works)
Beeing explicit here does not cost much for http-proxy, yet it's intrinsically complicated for browserify to fix (as trailing slash might be used as a pollyfill shim for native/non-natives addons i.e.  require('url/') vs require('url') )
2016-10-22 11:45:16 -04:00
Niranjan Ojha
f5217d6c20 test case added 2016-10-06 16:24:44 -04:00
Niranjan Ojha
2d01edc5a5 not setting connection header in case of http2 as it is deprecated 2016-10-06 16:24:44 -04:00
Ashish Dahiya
d0a1588639 Add proxy-timeout option to documentation (#1075)
http-proxy provides a [proxyTimeout option](https://github.com/nodejitsu/node-http-proxy/blob/master/lib/http-proxy/passes/web-incoming.js#L122) that allows us to set a timeout on the outgoing socket connection to the target. This timeout is very effective when the upstream target does not respond within an expected time.

I had wasted a few hours searching for this option. Documenting this option can save others a significant amount of time.
2016-10-04 09:54:52 -04:00
Jarrett Cruger
912cd3acae [dist] Version bump. 1.15.1 1.15.1 2016-09-14 17:12:30 -04:00
briman0094
84087208dd Properly write response header optionally including statusMessage (#1061) 2016-09-14 17:08:26 -04:00
Jarrett Cruger
b98c75b1ff [dist] Version bump. 1.15.0 1.15.0 2016-09-14 13:05:56 -04:00
Alex Indigo
b781af641a Made it not to crash with omited Host http header (#1050) 2016-09-14 07:03:48 -04:00
Michael Ira Krufky
cbd5777060 README.md: fix typo: 'ingoing' should be 'incoming' (#1060) 2016-09-14 07:02:30 -04:00
Cole Chamberlain
d8fb344715 Fix for Reason-Phrase being overwritten on proxy response. (#1051)
* Fix for Reason-Phrase being overwritten on proxy response.

Calling res.writeHead has the side effect of defaulting the Reason-Phrase to default ones.  I'm using Reason-Phrase codes to sub-route api responses and they were all being reset.  This change only sets the statusMessage (Reason-Phrase) if it exists on the proxyRes and is successfully passing it through in my tests.

* Fixed spaces and bracket formatting.
2016-09-13 18:19:33 -04:00
Jeremy Judeaux
1e52f660f0 cookieDomainRewrite option (#1009) 2016-08-12 13:42:18 -04:00
wuchangming
9d06ca99d3 Update ntlm-authentication.js (#1025) 2016-08-11 12:37:57 -04:00
Mati B. Terefe
d0e000e1f9 Restream body before proxying (#1027)
Support for bodyparser.json and bodyparser.urlencoded.

Fixes #955 #843 #791
2016-08-11 12:37:32 -04:00
Gabriel Boucher
183b5bb4fc Location rewriting for responses with status 201 (#1024)
Implement rewriting of the location header for responses with status code 201, according to RFC2616 section 10.2.2
2016-08-11 12:36:17 -04:00
Ken
3a347af543 #866 Copy CA from options into outbound proxy (#1042)
While using secure: true for proxy connections, there is no way to pass the trusted root CA(s) or intermediate CA(s). This change allows that to be passed in the httpProxy createServer options and used for the outgoing proxy connection.
2016-08-11 12:20:35 -04:00
Jarrett Cruger
fcfb0b37f6 [dist] Version bump. 1.14.0 1.14.0 2016-06-15 10:52:53 -04:00
Deividy Metheler
42df703830 Emit disconnected event instead of error when ECONNRESET (#966)
* Emit disconnected event instead of error when ECONNRESET

ECONNRESET means the other side of the TCP conversation abruptly
closed its end of the connection.

If we get an ECONNRESET error from the proxy request and the
socket is destroyed this means that the client has closed
his connection, and emit this as an error can lead to
confusion and hacks to filter that kind of message.

I think that the best we can do is abort and emit another event,
so if any caller wants to handle with that kind of error, he can
by listen the disconnected event.

https://github.com/nodejitsu/node-http-proxy/issues/813

* code standards, move econnreset check, change ev name
2016-06-03 13:39:40 -04:00
Jeremy Judeaux
3e966361bc fix test for node 0.10 + socket.io-client@1.4.6 (engine.io-client@1.6.9) (#1010) 2016-05-25 12:18:51 -04:00
Jarrett Cruger
5082acc067 [dist] Version bump. 1.13.3 1.13.3 2016-05-15 23:14:51 -04:00
idjem
433a7408cf fix browserify compatibility (#975) 2016-05-15 15:40:01 -04:00
Muromi Ukari
6baf1498cb alter message error (#998)
message error about port 9001 -> port 9002
2016-04-28 09:15:03 -07:00
Mihai Ene
284903d379 Sanitize header keys before setting them (#997)
Fixes #996.
2016-04-26 13:26:35 -07:00
Jarrett Cruger
b223275ebb Merge pull request #989 from aroder/patch-1
Update ntlm-authentication.js
2016-04-26 13:23:33 -07:00
Adam Roderick
ecdfff408f Update ntlm-authentication.js
missing bracket
2016-04-14 16:21:39 -05:00
Jarrett Cruger
28cecb5a96 Merge pull request #983 from deanshelton913/add-datatype-to-readme
Add expected datatype to readme
2016-03-23 18:36:21 -04:00
deanshelton913
bdb3492b21 Add expected datatype to readme
This confused me while attempting to use this feature
2016-03-23 15:19:50 -07:00
Jarrett Cruger
a4b2857216 Merge pull request #982 from kylehayes/patch-1
Update README
2016-03-22 15:13:09 -04:00
Kyle Hayes
820fc5987c Update README
For clarity
2016-03-22 08:47:14 -07:00
indexzero
f345a1ac2d [dist] Update LICENSE to reflect 2015 changes. 2016-03-12 00:05:21 -08:00
Jarrett Cruger
018352955e Merge pull request #974 from bmac/patch-1
Fix formatting of the `headers` option
2016-03-08 17:26:38 -08:00
Brendan McLoughlin
f8d605d53f Fix formatting of the headers option 2016-03-08 18:07:11 -05:00
Jarrett Cruger
c1440b58f1 Merge pull request #967 from jbacklund/patch-1
Set the x-forwarded-host flag when xfwd is enabled
2016-02-26 09:52:26 -08:00
Jakob Backlund
ef86b50427 Set the x-forwarded-host flag when xfwd is enabled
Reasoning: Rack's request class [makes use of](https://github.com/rack/rack/blob/master/lib/rack/request.rb#L243) this HTTP header. Certain edge-case scenarios (proxying from ember-cli to a Rails backend) can be problematic without this header being present.

/cc @perlun, @jesjos
2016-02-26 14:29:55 +02:00
Jarrett Cruger
e1b2f4c31b [dist] Version bump. 1.13.2 1.13.2 2016-02-17 11:00:08 -05:00
Jarrett Cruger
820f198729 Merge pull request #806 from chimurai/master
Fixed missing documentation: #options.headers
2016-02-16 18:05:28 -05:00
Jarrett Cruger
d2df053677 Merge pull request #950 from caioquirino/master
#949 Proxy example using req instead res on README
2016-02-15 10:36:24 -05:00
Jarrett Cruger
7357200334 Merge pull request #962 from Turbo87/default-mocha-reporter
mocha: Use default reporter
2016-02-15 10:35:41 -05:00
Jarrett Cruger
d19be83858 Merge pull request #961 from Turbo87/transfer-encoding-fix
Remove "transfer-encoding" header if "content-length" is set to zero
2016-02-15 10:35:32 -05:00
Tobias Bieniek
570cf3b4f9 mocha: Use default reporter
Unfortunately the "landing" reporter doesn't really look good on CI servers at all...
2016-02-15 15:47:46 +01:00
Tobias Bieniek
5c46e4b754 Remove "transfer-encoding" header if "content-length" is set to zero 2016-02-15 15:43:14 +01:00
Caio Quirino da Silva
25e56d0182 #949 Proxy example using req instead res on README
README example implies request instead of response parameter
2016-02-02 11:56:39 -02:00
Jarrett Cruger
9d9fa940cf [dist] Version bump. 1.13.1 1.13.1 2016-02-01 21:02:33 -08:00
Jarrett Cruger
2831d9a4f9 Merge pull request #932 from afriza/patch-1
README.md: summary to specify reverse proxy
2016-02-01 20:59:49 -08:00
Jarrett Cruger
a379d160f3 Merge pull request #947 from coderaiser/fix-urlJoin
fix(common) urlJoin replace: ":/" -> "http?s:/"
2016-02-01 20:59:18 -08:00
Jarrett Cruger
7aed1f4559 Merge pull request #948 from Alfredo-Delgado/patch-1
Update README.md
2016-02-01 20:58:45 -08:00