Re: njs and subrequests

2018-11-26 Thread Antoine Bonavita
Hello Valentin, On Thu, Nov 22, 2018 at 9:11 PM Valentin V. Bartenev wrote: > On Sunday, 18 November 2018 18:06:27 MSK Antoine Bonavita wrote: > > Hello Valentin, > > > > And thank you for your prompt answer. Writing such a http client and > making > > it available is probably a pretty big work.

Re: njs and subrequests

2018-11-22 Thread Valentin V. Bartenev
On Sunday, 18 November 2018 18:06:27 MSK Antoine Bonavita wrote: > Hello Valentin, > > And thank you for your prompt answer. Writing such a http client and making > it available is probably a pretty big work. But if I were to write a > "limited" one that would fit my simple needs (GET only, only H

Re: njs and subrequests

2018-11-21 Thread Antoine Bonavita
Hello Dmitry, Thanks for your answer. I understand locations can be configured to proxy to external locations and therefore be used in subrequests from njs. That is what I am doing for now. I consider this to be a workaround. Before I explain why, I should explain the basics of my pet project. You

Re: njs and subrequests

2018-11-19 Thread Dmitry Volyntsev
Hi Antoine, >Is there any plan to have subrequest from ngx_http_js_module support > external URLs ? Nothing prevents you from making subrequests to external URLs. https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass https://nginx.org/en/docs/http/ngx_http_core_module.html#reso

Re: njs and subrequests

2018-11-18 Thread Antoine Bonavita
Hello Valentin, And thank you for your prompt answer. Writing such a http client and making it available is probably a pretty big work. But if I were to write a "limited" one that would fit my simple needs (GET only, only HTTP/1.1, response in memory, etc.) trying to re-use what already exists in

Re: njs and subrequests

2018-11-17 Thread Valentin V. Bartenev
On Saturday, 17 November 2018 17:06:12 MSK Antoine Bonavita wrote: > Hello, > > For a pet project of mine I'm trying to use njs to retrieve data from a > number of different sources (URLs really) and assemble them into one single > response. I tried to implement a proof of concept using subrequest

njs and subrequests

2018-11-17 Thread Antoine Bonavita
Hello, For a pet project of mine I'm trying to use njs to retrieve data from a number of different sources (URLs really) and assemble them into one single response. I tried to implement a proof of concept using subrequest (from ngx_http_js_module) to do so. I quickly realized that it works only fo