129 Commits

Author SHA1 Message Date
indexzero
dd1d08b631 [fix test] Update tests. 2019-08-22 02:12:51 -05:00
indexzero
7e4a0e511b [dist] New test fixtures. 2019-08-22 02:12:51 -05:00
indexzero
a9b09cce43 [dist] End of an era. 2019-08-22 02:12:51 -05:00
Jarrett Cruger
4a37175a52 [test] add test for selfHandleRequest and remove modifyResponse as selfHandleRequest is the only way that functionality works 2018-04-20 11:35:07 -04:00
Gustav Tiger
bab02e909e Include websocket non-upgrade response
When the server do not accept the upgrade request for websockets the
server's response was previously not included and sent back. Now the
proxy will include the response in these cases. Fixes #890.
2018-04-20 11:35:07 -04:00
n30n0v
c9a556cfa5 Add followRedirects option 2018-04-20 11:35:07 -04:00
Jarrett Cruger
81d58c531b [test] for override method feature 2018-04-20 11:35:07 -04:00
Sean Willis
f5c2381395 Updating docs and adding more tests. 2018-04-20 11:35:07 -04:00
Sean Willis
2c98416ac2 Adding ability to set cookie path 2018-04-20 11:35:07 -04:00
Jarrett Cruger
09dcb98456 [dist] make tests work reliably, add package-lock.json 2018-04-20 11:35:07 -04:00
Georgi Yordanov
812757541d Fix overwriting of global options (#1074) 2018-01-02 19:48:17 -05:00
Yuta Shimizu
961f457622 [WIP] Revert default behavior of writeHeaders method (#1104)
* Replace header key only

* Add preserveHeaderKeyCase Option
2016-12-06 09:51:01 -05:00
Kris Williams
8cb451f20c Enable proxy response to have multiple Set-Cookie raw headers #1101 2016-12-04 10:58:49 -05:00
Yuta Shimizu
4edbb62cc5 Keep original letter case of response header keys (#1098)
* Keep original letter case of response header keys

* Support node older than v0.11.6

messege.rawHeaders was added in v0.11.6

* Extract duplicated logic to method
2016-12-01 20:03:13 -05:00
Maarten ter Horst
69cf892519 Handle errors for forward request, add test case (#1099) 2016-12-01 09:39:46 -05:00
Niranjan Ojha
f5217d6c20 test case added 2016-10-06 16:24:44 -04:00
Alex Indigo
b781af641a Made it not to crash with omited Host http header (#1050) 2016-09-14 07:03:48 -04:00
Jeremy Judeaux
1e52f660f0 cookieDomainRewrite option (#1009) 2016-08-12 13:42:18 -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
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
indexzero
f345a1ac2d [dist] Update LICENSE to reflect 2015 changes. 2016-03-12 00:05:21 -08:00
Tobias Bieniek
5c46e4b754 Remove "transfer-encoding" header if "content-length" is set to zero 2016-02-15 15:43:14 +01:00
coderaiser
7bad3fbca4 fix(common) urlJoin replace: ":/" -> "http?s:/" 2016-01-29 02:47:12 -05:00
Torstein Thune
f9540de7b1 Fixed tests depending on ignorePath 2016-01-13 15:24:46 +01:00
Aaron T. Maturen
e4760727f1 SSE example and test 2015-12-06 19:34:42 -05:00
glortho
64fa520789 Add tests for testing forwarding of continuation frames
This adds two tests that send payloads below and at the threshold for continuation frames. Using node 0.12.7 both tests pass. Using node 4.1.2 the test below the threshold passes but the other fails.
2015-10-28 15:52:37 -04:00
Laurent Brucher
9752652e76 fixes after PR review 2015-10-22 18:38:58 +02:00
Laurent Brucher
a05fc2d169 Provide a "proxyReq" event also for websocket connections. 2015-10-22 15:56:34 +02:00
donasaur
eb97bf5423 Removed unspecified trailing slash in proxy url 2015-10-18 13:04:06 -07:00
Arttu Liimola
ca73208749 Websocket key was unnecessary long. 2015-08-30 17:16:36 -04:00
Arttu Liimola
855cebdac4 Added websocket set-cookie headers test 2015-08-30 17:16:00 -04:00
Jarrett Cruger
0db8f195d7 Merge pull request #759 from nodejitsu/ignore-path
[api] add an ignorePath option if you want to disregard the path of the ...
2015-04-20 16:47:27 -04:00
Jarrett Cruger
c6dfb04a67 [fix] properly support iojs with test checking for HTTPS 2015-04-02 12:30:55 -04:00
Jeremy Judeaux
0ee314c436 fix expected error message when node 0.12.x 2015-04-02 14:22:26 +02:00
Jeremy Judeaux
c33d1616cd force cipher AES128-GCM-SHA256 in https tests 2015-04-02 14:11:45 +02:00
Jarrett Cruger
5a969d077b Merge pull request #787 from mokafive/master
Fixes / additions to URL rewriting
2015-04-01 12:20:37 -04:00
Damon McMinn
d145152655 Add test for https://github.com/nodejitsu/node-http-proxy/issues/747 2015-04-01 13:14:11 +01:00
ashubham
e907d7bb2a end of file line space 2015-03-12 15:17:26 -07:00
ashubham
7298510e91 space instead of tabs 2015-03-12 15:16:17 -07:00
ashubham
63c9262df5 space instead of tabs 2015-03-12 15:14:49 -07:00
ashubham
df158bfc53 added auth header test 2015-03-12 15:11:56 -07:00
ashubham
f55ffa356a auth header added tests 2015-03-12 13:40:49 -07:00
Matt Hauck
26029ba7ac only rewrite redirect urls when it matches target
if functioning as a reverse proxy for host1.foo.com,
with a backend target of backend.foo.com:8080, the
node proxy should only rewrite the redirect if it is
a redirect to somewhere on backend.foo.com:8080
2015-03-09 13:17:52 -07:00
Matt Hauck
14415a5074 refactor some tests for greater readability 2015-03-09 11:49:28 -07:00
Matt Hauck
7f2f3ac35c Add support for auto host rewriting and protocol rewriting
auto host rewriting allows rewriting to work as expected in most
cases without extra cumbersome configuration

protocol rewriting allows node-http-proxy to be able to listen
over HTTPS and properly reverse-proxy to sites running over HTTP
(to avoid doing SSL twice)
2015-02-05 12:17:26 -08:00
Jarrett Cruger
9eefd4678e [api] add an ignorePath option if you want to disregard the path of the incoming request when proxying to the target server fixes #758 2014-12-23 13:22:49 -05:00
Alistair Jones
402ab05734 Pass HTTPS client parameters.
For more detailed control over HTTPS client behaviour, pass through the
parameters listed here:
http://nodejs.org/api/https.html#https_https_request_options_callback

The `rejectUnauthorized` parameter is omitted, because it overlaps with
the existing `secure` parameter:
https://github.com/nodejitsu/node-http-proxy/blob/master/README.md#using-https

Conflicts:
	test/lib-http-proxy-common-test.js
2014-12-17 10:09:29 -07:00
Jorge Leal
8a8a894092 Changed proxyServer and destiny to local variables. 2014-12-17 00:52:41 -07:00
Jorge Leal
c62610e8e4 Deprecated proxySocket event in favor to open event.
Maintained both proxySocket and open for backward compatibility.

Conflicts:
	test/lib-http-proxy-test.js
2014-12-17 00:52:19 -07:00