97 Commits

Author SHA1 Message Date
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
Jorge Leal
8bff3ddc12 Added websocket close event test 2014-12-17 00:51:19 -07:00
Eugene Zhdan
c1a94176a8 Fix variables scope in test 2014-12-13 21:45:14 +03:00
Jarrett Cruger
89f9ca1e89 [test] show that we support protocol without the colon 2014-12-08 23:04:41 -05:00
Jarrett Cruger
71a06aab02 [test] add tests for the changeOrigin cases in properly setting the host header 2014-12-08 16:14:48 -05:00
Jarrett Cruger
410a8ce94c [test] add proper failing test case for #738 2014-12-02 10:25:30 -07:00
Jarrett Cruger
d98d9516ea [fix] simple fixes #748 #744 #746 2014-12-02 09:58:06 -07:00
koolc
70ed1c4273 [Bugfix] Allow for multiple ? in outgoing urls.
Without this fix urls that had multiple ? in them would drop sections
of the url since before there was an assumption of there only being one.
2014-12-01 12:34:16 -05:00
Jarrett Cruger
95a588706b Merge pull request #741 from samccone/sjs/redirect-host-rewrite
Allow optional redirect host rewriting.
2014-11-25 17:08:54 -05:00
Mike Pennisi
8a24a1e18f Set Content-Length header for OPTIONS requests
Web browsers automatically issue an OPTIONS request in advance of other
HTTP requests when the document's domain does not match the target in
order to facilitate Cross-Origin Resource Sharing. These requests are
forbidden from specifying a body and typically do not specify an
(unecessary) `Length` header.

Node.js automatically adds the `Content-Encoding: chunked` header value
to requests that do not specify a `Length` header. This makes proxied
OPTIONS requests from web browsers invalid.

Explicitly set the `Content-Length` header of all `OPTIONS` requests to
"0", disabling the default "chunked" encoding behavior [2].

[1] http://www.w3.org/TR/cors/
[2] http://nodejs.org/api/http.html
2014-11-24 17:14:48 -05:00
Sam Saccone
add81338a9 📝 Add host rewrite docs and specs. 2014-11-23 19:22:07 -05:00
Ricky Miller
84036e9ddd style changes 2014-11-13 06:05:32 +09:00
Ricky Miller
daa2ce0ee3 copy headers instead of referencing them so they don't unexpectedly get overwritten 2014-11-13 04:37:45 +09:00
Ricky Miller
4a2b870cc9 do not modify the query string 2014-11-09 08:44:22 +09:00
Alex Oshchepkov
796ab0bcc5 Added changeOrigin option with test and docs 2014-10-29 07:25:19 +05:00
MinRK
c62766391e close socket if upstream request fails
adds socket.end() to on('error') handlers for proxyReq and proxySocket
2014-09-30 19:58:57 -07:00
MinRK
77305489d9 test closing upstream socket prior to upgrade
should close the client socket with ECONNRESET,
but currently is left hanging.
2014-09-30 16:11:49 -07:00
MinRK
ec683b924b test new detection of connection: upgrade 2014-09-16 12:09:26 -07:00
Samuel Reed
73d865bc9f Fix breaking bug on url joining resulting in paths like ///path.
Added OS-agnostic url join helper.
2014-09-12 13:08:10 -04:00
Jarrett Cruger
e44fabe58a [test] add test for prependPath option 2014-09-11 18:51:49 -04:00
Sean Massa
a65021d52b fix tests for maintaining proxy path 2014-09-08 17:17:15 -05:00
John Catron
a3d02196c5 Added close method to proxy server.
Ensured server exists before closing.
Updated tests to use new close function.
Added documentation to README.
2014-08-14 17:30:38 +00:00
Manu Sporny
db5f2954b2 [api] Add event-based ability to modify pre-flight proxy requests. 2014-07-18 11:46:04 -04:00
Damian Kaczmarek
7b79a7409a Change name targetTimeout to proxyTimeout 2014-06-10 19:04:12 +02:00
Damian Kaczmarek
4193d3bd74 Fix #657 2014-06-10 01:50:59 +02:00
Damian Kaczmarek
0f243516e1 Added targetTimeout option and two tests for timeout 2014-06-10 01:35:53 +02:00
Bryce Gibson
1385635e18 Add a test for the proxyRes event 2014-05-12 08:44:02 +10:00
Jay Harris
8aa7c519b1 Adding test cases on preventing upgrade override 2014-05-09 22:49:23 -04:00
Jarrett Cruger
61c8734e8b [fix test] handle proxy error since we are properly aborting the proxy Request 2014-04-14 13:17:18 -04:00
Sam Beran
e633b0f7e4 Add support for localAddress
When we make outgoing requests, we may want to bind to a specific local
address. This change allows the localAddress property to be specified
via the options object.
2014-02-11 15:01:03 -06:00
David Glasser
0b223abb65 Fix argument order for ws stream pass
head and error handling was broken before this commit.
2014-01-22 15:28:23 -08:00
cronopio
d83fdf69a1 [tests] disabled the examples-test by now 2013-12-18 12:18:59 -05:00
cronopio
bc236d7e95 [tests] Added a test case for run all the examples
* I changed all the ports across examples to be different and can run at same time
2013-12-18 12:18:58 -05:00