Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Use with node-http-proxy #88

Closed
srcnix opened this issue Dec 14, 2016 · 4 comments
Closed

Use with node-http-proxy #88

srcnix opened this issue Dec 14, 2016 · 4 comments

Comments

@srcnix
Copy link

srcnix commented Dec 14, 2016

Could someone give me an example of how to use a streaming response from node-http-proxy as a template input?

My templates come through node-http-proxy and I ideally need to then pipe this response through to tailor - any thoughts welcomed!

@rikkert
Copy link
Contributor

rikkert commented Dec 14, 2016

You are doing this in the fetchTemplate right?

@srcnix
Copy link
Author

srcnix commented Dec 14, 2016

@rikkert, currently, yes. However, I'm receiving an error stating that headers can no longer be modified as they have already been sent - which I am assuming node-http-proxy has done.

I'm wondering if it's possible to apply Tailor to just before node-http-proxy streams the response.

@vigneshshanmugam
Copy link
Collaborator

@srcnix Sorry for the delay...was in vacation. Can you point me to an example repo or gist? I will play with it and let you know.

@srcnix
Copy link
Author

srcnix commented Dec 18, 2016

@vigneshshanmugam, I actually managed to get this working. node-http-proxy ends a response itself, so I had to override the response on 'end' event.

@srcnix srcnix closed this as completed Dec 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants