<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/src/nodejs/unit-http, branch 1.34.2-1</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<entry>
<title>Add additional replace rules for node:* modules</title>
<updated>2024-02-20T12:35:07+00:00</updated>
<author>
<name>Gabor Javorszky</name>
<email>g.javorszky@f5.com</email>
</author>
<published>2023-12-07T15:07:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=d24ae5a9a4b1140695e027087e72dcfdeb484ec0'/>
<id>d24ae5a9a4b1140695e027087e72dcfdeb484ec0</id>
<content type='text'>
In that particular issue the compiled nuxt files end up importing the
http module as node:http rather than http only. This bypasses unit's
custom loader implementation which only check for the http or unit-http
modules, and their websocket counterparts.

This changeset adds replace sources for both the node:http and
node:websocket import signatures.

Closes: https://github.com/nginx/unit/issues/1013
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In that particular issue the compiled nuxt files end up importing the
http module as node:http rather than http only. This bypasses unit's
custom loader implementation which only check for the http or unit-http
modules, and their websocket counterparts.

This changeset adds replace sources for both the node:http and
node:websocket import signatures.

Closes: https://github.com/nginx/unit/issues/1013
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Node.js: Use console.warn instead of stderr.write</title>
<updated>2024-02-19T14:56:57+00:00</updated>
<author>
<name>Dan Callahan</name>
<email>d.callahan@f5.com</email>
</author>
<published>2024-02-19T12:22:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=756feafd541160e97edfb6faf13e9942271629ce'/>
<id>756feafd541160e97edfb6faf13e9942271629ce</id>
<content type='text'>
Functionally identical, but marginally more idiomatic.

Refines: fbeb2065b180e2376088387ee150d3975dc08cd5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Functionally identical, but marginally more idiomatic.

Refines: fbeb2065b180e2376088387ee150d3975dc08cd5
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: Take options as well as requestListener (#1091)</title>
<updated>2024-02-14T18:16:01+00:00</updated>
<author>
<name>Gabor Javorszky</name>
<email>g.javorszky@f5.com</email>
</author>
<published>2024-02-14T18:16:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=fbeb2065b180e2376088387ee150d3975dc08cd5'/>
<id>fbeb2065b180e2376088387ee150d3975dc08cd5</id>
<content type='text'>
* Take options as well as requestListener

Unit-http have not kept up with the signature of nodejs's http package
development. Nodejs allows an optional `options` object to be passed to
the `createServer` function, we didn't. This resulted in function
signature errors when user code that did make use of the options arg
tried to call unit's replaced function.

This change changes the signature to be more in line with how nodejs
does it discarding it and printing a message to stdout.

* Add test file to start node application with options

* Add changes to docs/changes.xml

Closes: https://github.com/nginx/unit/issues/1043</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Take options as well as requestListener

Unit-http have not kept up with the signature of nodejs's http package
development. Nodejs allows an optional `options` object to be passed to
the `createServer` function, we didn't. This resulted in function
signature errors when user code that did make use of the options arg
tried to call unit's replaced function.

This change changes the signature to be more in line with how nodejs
does it discarding it and printing a message to stdout.

* Add test file to start node application with options

* Add changes to docs/changes.xml

Closes: https://github.com/nginx/unit/issues/1043</pre>
</div>
</content>
</entry>
<entry>
<title>Node.js: fixed "httpVersion" variable format</title>
<updated>2024-01-26T15:17:00+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2024-01-25T12:49:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=6452ca111c71188ab2813c763e6a0e86b48fbd56'/>
<id>6452ca111c71188ab2813c763e6a0e86b48fbd56</id>
<content type='text'>
According to the Node.js documenation this variable
should only include numbering scheme.

Thanks to @dbit-xia.

Closes: https://github.com/nginx/unit/issues/1085
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the Node.js documenation this variable
should only include numbering scheme.

Thanks to @dbit-xia.

Closes: https://github.com/nginx/unit/issues/1085
</pre>
</div>
</content>
</entry>
<entry>
<title>White space formatting fixes</title>
<updated>2024-01-16T15:37:07+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2024-01-16T15:37:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=a1e00b4e28d56365b4b5cc4aa44185c4b53f5c33'/>
<id>a1e00b4e28d56365b4b5cc4aa44185c4b53f5c33</id>
<content type='text'>
Closes: &lt;https://github.com/nginx/unit/pull/1062&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes: &lt;https://github.com/nginx/unit/pull/1062&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Node.js: ServerResponse.flushHeaders() implemented.</title>
<updated>2023-11-17T17:27:31+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2023-11-17T17:27:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=1443d623d4b5d59e4463e025b4125be9a5aa3436'/>
<id>1443d623d4b5d59e4463e025b4125be9a5aa3436</id>
<content type='text'>
This closes #1006 issue on GitHub.

Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This closes #1006 issue on GitHub.

Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Node.js: provide reasonable default paths for macOS.</title>
<updated>2023-09-26T23:14:21+00:00</updated>
<author>
<name>Konstantin Pavlov</name>
<email>thresh@nginx.com</email>
</author>
<published>2023-09-26T23:14:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=f1ce2a5ac2ba3266d525544445366fae538d7194'/>
<id>f1ce2a5ac2ba3266d525544445366fae538d7194</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Node.js: ServerRequest.destroy() implemented.</title>
<updated>2023-09-26T11:49:39+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2023-09-26T11:49:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=2d0e502d2a69ad490e0633c59636e1115afa983d'/>
<id>2d0e502d2a69ad490e0633c59636e1115afa983d</id>
<content type='text'>
This closes #871 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This closes #871 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Node.js: response body chunk can now be a Uint8Array.</title>
<updated>2023-09-26T11:49:39+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2023-09-26T11:49:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=e0c26757740fa7974af6e6592e35b5f2e00339fe'/>
<id>e0c26757740fa7974af6e6592e35b5f2e00339fe</id>
<content type='text'>
Starting from Node.js 15.0.0 the chunk parameter of the response.write()
can be a Uint8Array.

This closes #870 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Starting from Node.js 15.0.0 the chunk parameter of the response.write()
can be a Uint8Array.

This closes #870 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Auto: mirroring installation structure in build tree.</title>
<updated>2023-03-28T22:41:08+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx@nginx.com</email>
</author>
<published>2023-03-22T15:55:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=6e16d7ac5bb86140a55ea30a35c69ee0df3eff8d'/>
<id>6e16d7ac5bb86140a55ea30a35c69ee0df3eff8d</id>
<content type='text'>
This makes the build tree more organized, which is good for adding new
stuff.  Now, it's useful for example for adding manual pages in man3/,
but it may be useful in the future for example for extending the build
system to run linters (e.g., clang-tidy(1), Clang analyzer, ...) on the
C source code.

Previously, the build tree was quite flat, and looked like this (after
`./configure &amp;&amp; make`):

    $ tree -I src build
    build
    ├── Makefile
    ├── autoconf.data
    ├── autoconf.err
    ├── echo
    ├── libnxt.a
    ├── nxt_auto_config.h
    ├── nxt_version.h
    ├── unitd
    └── unitd.8

    1 directory, 9 files

And after this patch, it looks like this:

    $ tree -I src build
    build
    ├── Makefile
    ├── autoconf.data
    ├── autoconf.err
    ├── bin
    │   └── echo
    ├── include
    │   ├── nxt_auto_config.h
    │   └── nxt_version.h
    ├── lib
    │   ├── libnxt.a
    │   └── unit
    │       └── modules
    ├── sbin
    │   └── unitd
    ├── share
    │   └── man
    │       └── man8
    │           └── unitd.8
    └── var
        ├── lib
        │   └── unit
        ├── log
        │   └── unit
        └── run
            └── unit

    17 directories, 9 files

It also solves one issue introduced in
5a37171f733f ("Added default values for pathnames.").  Before that
commit, it was possible to run unitd from the build system
(`./build/unitd`).  Now, since it expects files in a very specific
location, that has been broken.  By having a directory structure that
mirrors the installation, it's possible to trick it to believe it's
installed, and run it from there:

    $ ./configure --prefix=./build
    $ make
    $ ./build/sbin/unitd

Fixes: 5a37171f733f ("Added default values for pathnames.")
Reported-by: Liam Crilly &lt;liam@nginx.com&gt;
Reviewed-by: Konstantin Pavlov &lt;thresh@nginx.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Cc: Andrei Zeliankou &lt;zelenkov@nginx.com&gt;
Cc: Zhidao Hong &lt;z.hong@f5.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes the build tree more organized, which is good for adding new
stuff.  Now, it's useful for example for adding manual pages in man3/,
but it may be useful in the future for example for extending the build
system to run linters (e.g., clang-tidy(1), Clang analyzer, ...) on the
C source code.

Previously, the build tree was quite flat, and looked like this (after
`./configure &amp;&amp; make`):

    $ tree -I src build
    build
    ├── Makefile
    ├── autoconf.data
    ├── autoconf.err
    ├── echo
    ├── libnxt.a
    ├── nxt_auto_config.h
    ├── nxt_version.h
    ├── unitd
    └── unitd.8

    1 directory, 9 files

And after this patch, it looks like this:

    $ tree -I src build
    build
    ├── Makefile
    ├── autoconf.data
    ├── autoconf.err
    ├── bin
    │   └── echo
    ├── include
    │   ├── nxt_auto_config.h
    │   └── nxt_version.h
    ├── lib
    │   ├── libnxt.a
    │   └── unit
    │       └── modules
    ├── sbin
    │   └── unitd
    ├── share
    │   └── man
    │       └── man8
    │           └── unitd.8
    └── var
        ├── lib
        │   └── unit
        ├── log
        │   └── unit
        └── run
            └── unit

    17 directories, 9 files

It also solves one issue introduced in
5a37171f733f ("Added default values for pathnames.").  Before that
commit, it was possible to run unitd from the build system
(`./build/unitd`).  Now, since it expects files in a very specific
location, that has been broken.  By having a directory structure that
mirrors the installation, it's possible to trick it to believe it's
installed, and run it from there:

    $ ./configure --prefix=./build
    $ make
    $ ./build/sbin/unitd

Fixes: 5a37171f733f ("Added default values for pathnames.")
Reported-by: Liam Crilly &lt;liam@nginx.com&gt;
Reviewed-by: Konstantin Pavlov &lt;thresh@nginx.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Cc: Andrei Zeliankou &lt;zelenkov@nginx.com&gt;
Cc: Zhidao Hong &lt;z.hong@f5.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
