examples icon indicating copy to clipboard operation
examples copied to clipboard

http-proxy example 400 response

Open cherishs001 opened this issue 5 years ago • 5 comments

having some trouble with the http-proxy example. It seems ClientRequest.send_stream results in a 400 response for any request that actually has a request body. It never even seems to hit the thing being proxied to. Not sure if I'm missing something or if the example is broken.

cherishs001 avatar Nov 08 '19 08:11 cherishs001

Probably fixed by #186. Could you check?

svenstaro avatar Nov 15 '19 18:11 svenstaro

Does #186 mean actix can't do stream proxying? This sounds like a dealbreaker for use cases where large request payloads are received (i.e. > 10MB).

cosminci avatar Nov 22 '19 12:11 cosminci

I didn’t follow up on the details in #186 but my guess is that this limitation is only relevant to Actix’s web client. I use actix to stream large request bodies to Amazon S3 without reading them all into memory. You will, however, need to do some more boilerplate setup given the current limitations of send and sync on errors and such

vmalloc avatar Nov 22 '19 13:11 vmalloc

Optimally, the proxy would either stream a request or not depending on whether the awc response detects the proxied upstream to send transfer-encoding: chunked or not. Might be a fun change for the proxy example and shouldn't be too hard either.

On Fri, Nov 22, 2019, 14:57 Rotem Yaari [email protected] wrote:

I didn’t follow up on the details in #186 https://github.com/actix/examples/pull/186 but my guess is that this limitation is only relevant to Actix’s web client. I use actix to stream large request bodies to Amazon S3 without reading them all into memory. You will, however, need to do some more boilerplate setup given the current limitations of send and sync on errors and such

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/actix/examples/issues/188?email_source=notifications&email_token=AAAANAFIX5KBX4AL2OQDNL3QU7QMZA5CNFSM4JKT5MZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE5WQDA#issuecomment-557541388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAANAA73M5TD33GBJVW3WTQU7QMZANCNFSM4JKT5MZQ .

svenstaro avatar Nov 22 '19 16:11 svenstaro

Any idea or any help on correct streaming?

EDIT: while testing, it seems actix-web's streaming method works well so I think the problem is just on awc

0x8f701 avatar Mar 25 '20 09:03 0x8f701