Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxying uploads and downloads #5

Open
Lazarus404 opened this issue Apr 8, 2016 · 4 comments
Open

Proxying uploads and downloads #5

Lazarus404 opened this issue Apr 8, 2016 · 4 comments

Comments

@Lazarus404
Copy link

Is this library capable of proxying uploaded and downloaded files between Plug and the HTTP client? If so, are their any examples of these?

Thanks,
Lee

@slogsdon
Copy link
Owner

Hi @Lazarus404! Sorry for the delay.

I do not have any examples of this, and as of now, this isn't something that I've tested or looked into at any depth. That being said, I'd be more than happy to help correct any issues that arise.

@Lazarus404
Copy link
Author

Hi slogsdon,

Do you have any notion of how to get started with it? Any ideas for pointers? There's a disconnect in my brain of taking the stream from one down/upload and piping it to another down/upload. It'd be a pretty powerful feature, though, imho.

@slogsdon
Copy link
Owner

I believe this should happen automagically via regular HTTP requests and responses since Plug only considers request/response bodies as being of type iolist.

For uploads, we read the request body from the client and pass it to the upstream. Granted, we may not be reading the entire request body at the moment.

For downloads, the upstream responds, and we take the body of the upstream response and set it as the client response.

@Lazarus404
Copy link
Author

Lazarus404 commented Apr 15, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants