Arttu Liimola
3d2350c54f
Replaced Object.keys().map with for in loop.
2015-08-30 17:16:42 -04:00
Arttu Liimola
da674ec4df
Modify the set-cookie header fix to work with node 0.10.x.
2015-08-30 17:16:07 -04:00
Arttu Liimola
8bfd90c4d9
Use raw headers instead parsed.
...
Set-Cookie headers are parsed into single header with cookies in array.
This messes up the Set-Cookie headers, because browser receives multiple Set-Cookie headers as single with cookies separted with comma.
2015-08-30 17:15:54 -04:00
Jeremy Judeaux
5f14bcaa70
fix protocol and default port detection on node 0.12.x, compatible with 0.10.x
2015-04-02 14:23:58 +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
Feross Aboukhadijeh
6d074eff47
fix "x-forwarded-proto" in node 0.12 and iojs
...
The way to detect TLSSockets in node 0.12 and iojs has changed. You can
just check `socket.encrypted` now :)
Fixes #772
2015-03-11 00:33:34 -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
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
ea0a4ded80
[fix] style spacing wtf
2014-12-17 00:53:51 -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
26537866b3
[api] add close event in ws-incoming.js
2014-12-17 00:51:06 -07:00
Jarrett Cruger
c04485671a
[fix] use simple regex instead of indexOf to check the protocol to support without the colon fixes #711
2014-12-08 23:04:23 -05:00
Jarrett Cruger
8d68ac0e0f
[fix] be defensive and ensure location is in headers before running url.parse()
2014-11-25 17:22:23 -05:00
Jarrett Cruger
48ae5d828c
[minor] style consistency
2014-11-25 17:21:24 -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
daf66a7a88
Allow optional redirect host rewriting.
2014-11-23 19:22:07 -05:00
jleal52
9ba8311343
Updated to support error callback on proxy.web and start/proxyReq/end continue working.
2014-11-12 14:41:46 +00: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
bcd8a564a8
close websocket if proxyReq is closed before upgrade
...
avoids leaving client sockets open when upstream
connections are rejected.
2014-09-30 17:01:20 -07:00
Jarrett Cruger
10a294af4d
[fix] do a check to make sure the server exists before we try and emit
2014-09-30 15:22:52 -04:00
Thorsten Lorenz
000eb533de
emitting proxySocket on proxyServer
...
- emitted once proxySocket was created and socket was piped into it
- needed to support sniffing messages coming from proxy target
2014-09-29 20:09:46 -04:00
Manu Sporny
db5f2954b2
[api] Add event-based ability to modify pre-flight proxy requests.
2014-07-18 11:46:04 -04:00
Jarrett Cruger
d1baa3684e
[api] also emit the target on a proxy error
2014-07-08 16:12:57 -04:00
Damian Kaczmarek
7b79a7409a
Change name targetTimeout to proxyTimeout
2014-06-10 19:04:12 +02:00
Damian Kaczmarek
0f243516e1
Added targetTimeout option and two tests for timeout
2014-06-10 01:35:53 +02:00
Bryce Gibson
1213e46b1b
Add the req and res objects to the proxyRes event
2014-05-12 08:22:54 +10:00
Jarrett Cruger
77a1cff9bc
[fix] handle error on incoming request as well and properly abort proxy if client request is aborted
2014-04-14 13:08:10 -04:00
Jarrett Cruger
4f07dc220d
[fix] let user make the decision on what to do with the buffer
2014-04-10 20:02:46 -04:00
Jarrett Cruger
8b48a9fdab
[api] emit a start an an end event
2014-04-09 13:38:13 -04:00
David Glasser
4c3ba74c4e
Close outgoing ws if incoming ws emits error
...
Fixes #559 , which contains a full reproduction recipe.
2014-01-28 13:58:09 -05: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
yawnt
e936d186b6
[fix] closes #555
2014-01-19 11:49:26 +01:00
Mike Moulton
969a623542
Only emit response if a valid server is present
2014-01-14 00:45:42 -07:00
yawnt
97e4600e94
[fix] fixes #341
2013-12-18 12:33:23 +01:00
yawnt
10c0f11b68
[fix] remove duplicate
2013-11-19 20:05:46 +01:00
Ben Firshman
cb7af4f4d7
Fix websocket error handing
...
Websockets have sockets, not responses.
2013-11-18 23:06:56 +00:00
yawnt
961d2f9400
[fix] support target and forward
2013-11-08 20:56:26 +01:00
yawnt
d0862aff0c
[fix] merge #495 , thanks @glasser
2013-11-07 19:13:09 +01:00
yawnt
590bb604da
[fix] _ because it is unused
2013-11-07 19:00:01 +01:00
yawnt
dda6f7a45a
[feature] add emit proxyRes
2013-11-05 17:44:04 +01:00
yawnt
1204a35e46
[fix] support buffer
2013-10-29 18:12:23 +01:00
yawnt
e3f8d5fdbe
[feature] add buffer support
2013-10-26 17:20:30 +02:00
cronopio
02df9a33c5
[fix] fix the correct order of arguments in ws-incoming passes
2013-10-21 23:22:32 -05:00
cronopio
cc09ae6a34
[fix] use the correct arguments order
2013-10-21 21:19:52 -05:00
mmoulton
0bfb9be418
Fixed issue where error callback would not invoke, including new test cases. Added req/res values to error events.
...
Conflicts:
lib/http-proxy/passes/web-incoming.js
2013-10-21 17:36:20 -05:00
cronopio
5e130de854
Revert "[fix] fixed passes functions, now 'this' can be used and options are stored on 'this.options'"
...
This reverts commit 9b3e1eb247df29d18ea299ff4ebb2f10eeb71269.
2013-10-21 14:49:39 -05:00
cronopio
babdf531fe
Revert "[fix] fixed options and server reference to can access them from passes functions"
...
This reverts commit 90fb01d38ac5af7ef395547b24e985b6f63b4abc.
2013-10-21 14:45:03 -05:00
cronopio
2bf20d61d5
Revert "[tests] fix test to use the new way to pass options"
...
This reverts commit 52ecd52ee5aa78603e44ba8d5ff9187410351622.
2013-10-21 14:44:49 -05:00
cronopio
52ecd52ee5
[tests] fix test to use the new way to pass options
2013-10-21 03:59:14 -05:00