Hi Lance,
hope you're doing well.
On Wed, Aug 11, 2021 at 07:43:12PM -0500, Lance Dockins wrote:
> We’ve been experimenting with NJS in its current form (as compared
> with the more established LuaJIT integration provided by OpenResty)
> and it’s surfaced a series of questions about objects and
Hi Sergey,
Thank you. Perhaps something is going wrong with the implementation of r.args
that we’re using. I’m just getting an empty JS object for POST vars. Args
only seems to work for query string vars for me.
Here’s the key config info.
In the location block for the route that I’m
We’ve been experimenting with NJS in its current form (as compared with the
more established LuaJIT integration provided by OpenResty) and it’s surfaced a
series of questions about objects and features in NJS that the documentation,
examples, recordings, and 3rd party examples don’t seem to
Hi Sergey,
Sure. The tool that I’m using for HTTP testing is just a GUI interface
directly to HTTP so it works the same as a browser would since it’s just
straight HTTP. It supports curl mode too but that’s just a alternative wrapper
for HTTP and none of the methods that we’re using to
On Wed, Aug 11, 2021 at 09:31:41PM -0500, Lance Dockins wrote:
> Hi Sergey,
>
...
>
> dbadmin.js
> function access(r){
> r.return(200, JSON.stringify(r.args));
>
> r.internalRedirect('@php');
Two points:
- missing return directive here;
- r.internalRedirect will never happend because
On Wed, Aug 11, 2021 at 09:38:50PM -0500, Lance Dockins wrote:
> Oh… and to reiterate, I get similarly empty object responses
> when access the variables and rawVariables objects. Most of
> them seem to be empty objects, actually.
I'd recommend to enable nginx debugging log as I mentioned
Something is definitely wrong here but I’ve stripped most of the more advanced
configuration out of the vhost conf, removed all modules other than NJS, and
set the Nginx compile to pretty much the most vanilla compile option set that I
can to rule out the possibility of 3rd party interference
Hi Lance,
On Wed, Aug 11, 2021 at 09:05:32PM -0500, Lance Dockins wrote:
> Hi Sergey,
>
> Thank you. Perhaps something is going wrong with the implementation
> of r.args that we’re using. I’m just getting an empty JS object for
> POST vars. Args only seems to work for query string vars for
Oh… and to reiterate, I get similarly empty object responses when access the
variables and rawVariables objects. Most of them seem to be empty objects,
actually.
--
Lance Dockins
On Aug 11, 2021, 9:31 PM -0500, Lance Dockins , wrote:
> Hi Sergey,
>
> Sure. The tool that I’m using for HTTP
I’ll try recompiling nginx with that to see if that changes anything.
Also, to be clear, I know that r.internalRedirect won’t happen. I actually
stripped the access function down to almost it’s barest content to demonstrate
the point and left that code in there just to demo what we do at the
On Wed, Aug 11, 2021 at 09:48:48PM -0500, Lance Dockins wrote:
> I’ll try recompiling nginx with that to see if that changes anything.
I'd recommend to use official packages for Linux from the following URL,
http://nginx.org/en/linux_packages.html
> In fact, even your code is returning nothing.
Unfortunately, we can’t really use standard packages. We need extra modules.
I’m recompiling and enabling debug now. The modules we’re using aren’t
anything super abnormal and we might replace one of them with NJS at some
point. All I know for sure is that this seems to work just fine with
Also, just to be clear, you’re saying that r.args should include parsed POST
vars? Obviously it includes query string/GET vars. That works. But the
values in the POST body do not show up in the args output. And again, I
basically see nothing coming up in the output for variables.
This:
#
Thanks Thomas, that helps as I didn't know other frameworks use this idea.
How would I go about also keeping a communication channel open for
continuous data flow (for example, if I'd like to have nginx returning a
stream of jpeg files (MJPEG) after the proxy_pass all)?
Thank you!
Posted at
details: https://hg.nginx.org/njs/rev/3e00ce537115
branches:
changeset: 1685:3e00ce537115
user: Alexander Borisov
date: Wed Aug 11 21:48:51 2021 +0300
description:
Fixed resolve/reject callback for Promise.prototype.finally().
diffstat:
src/njs_promise.c | 75
details: https://hg.nginx.org/njs/rev/80adcb502e40
branches:
changeset: 1686:80adcb502e40
user: Alexander Borisov
date: Wed Aug 11 21:48:52 2021 +0300
description:
Added remaining Promise constructor methods.
The following methods were added: Promise.all(), Promise.allSettled(),
details: https://hg.nginx.org/njs/rev/eb6c1c9823f1
branches:
changeset: 1683:eb6c1c9823f1
user: Alexander Borisov
date: Wed Aug 11 21:48:50 2021 +0300
description:
Moving generic iterator code to a proper location.
diffstat:
src/njs_array.c| 441
details: https://hg.nginx.org/njs/rev/ca2f051a4fc9
branches:
changeset: 1684:ca2f051a4fc9
user: Alexander Borisov
date: Wed Aug 11 21:48:51 2021 +0300
description:
Introduced AggregateError implementation.
diffstat:
src/njs_builtin.c| 11
src/njs_error.c |
OS: macOS 11.5.2 (20G95)
NGINX запущен как контейнер, порты привязаны к хосту
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
19 matches
Mail list logo