7 Commits

Author SHA1 Message Date
Ryan Bourgeois
4e85f932e0 proxy: Reuse a bytes buffer as proxy request body.
The call to transport.RoundTrip closes the request body regardless of
the value of request.Closed. This causes subsequent calls to RoundTrip
using the same request body to fail.

Fixes #2895
2015-06-02 10:27:20 -07:00
Shota Fukumori (sora_h)
a68efe7d1e proxy: Fix connection leak when client disconnect
established connections were leaked when client disconnected before
proxyreq completes. This happens all time for wait=true requests.
2015-04-30 11:41:42 +09:00
Jonathan Boulle
f1ed69e883 *: switch to line comments for copyright
Build tags are not compatible with block comments.
Also adds copyright header to a few places it was missing.
2015-01-26 09:53:30 -08:00
Xiang Li
424377f859 proxy: add a todo for logging 2014-11-10 16:37:15 -08:00
Xiang Li
6fa8f77638 proxy: return JSON errors 2014-11-10 15:56:42 -08:00
Jonathan Boulle
7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
Brian Waldon
a155f0bda6 proxy: rewrite stdlib ReverseProxy
The ReverseProxy code from the standard library doesn't actually
give us the control that we want. Pull it down and rip out what
we don't need, adding tests in the process.

All available endpoints are attempted when proxying a request. If a
proxied request fails, the upstream will be considered unavailable
for 5s and no more requests will be proxied to it. After the 5s is
up, the endpoint will be put back to rotation.
2014-09-12 22:56:23 -07:00