<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/test/node, branch 1.34.0-1</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<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: 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>Tests: 8XXX used as default port range.</title>
<updated>2023-11-08T18:37:02+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2023-11-08T18:37:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=0b85fe29f7e49c88cab88aa9303d5885fa9c9dd5'/>
<id>0b85fe29f7e49c88cab88aa9303d5885fa9c9dd5</id>
<content type='text'>
After the launch of the project, the testing infrastructure was shared with
nginx project in some cases.  To avoid port overlap, a decision was made
to shift the port range for Unit tests.  This problem was resolved a long time
ago and is no longer relevant, so it is now safe to use port 8XXX range as the
default, as it is more appropriate for testing purposes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After the launch of the project, the testing infrastructure was shared with
nginx project in some cases.  To avoid port overlap, a decision was made
to shift the port range for Unit tests.  This problem was resolved a long time
ago and is no longer relevant, so it is now safe to use port 8XXX range as the
default, as it is more appropriate for testing purposes.
</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>Node.js: renamed "require_shim" to "loader".</title>
<updated>2021-05-24T09:01:42+00:00</updated>
<author>
<name>Oisin Canty</name>
<email>o.canty@f5.com</email>
</author>
<published>2021-05-24T09:01:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=c160ea11e4ece4db52731ac8b83dd09ca2d1ef11'/>
<id>c160ea11e4ece4db52731ac8b83dd09ca2d1ef11</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: a shim for overriding "http" and "websocket" modules.</title>
<updated>2021-05-12T09:26:55+00:00</updated>
<author>
<name>Oisin Canty</name>
<email>o.canty@f5.com</email>
</author>
<published>2021-05-12T09:26:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=a0c083af208cd9f676bb56762b4e27a3174a773d'/>
<id>a0c083af208cd9f676bb56762b4e27a3174a773d</id>
<content type='text'>
Also added stubs for Server.address()
This was done to prevent crashes in some popular frameworks like express

Supports both CommonJS and the new ES Modules system syntax e.g:

app.js:
const http = require('http')

app.mjs:
import http from "http"

Usage on Node 14.16.x and higher:
{
    "type": "external",
    "processes": {"spare": 0},
    "working_directory": '/project',
    "executable": "/usr/bin/env",
    "arguments": [
        "node",
        "--loader",
        "unit-http/require_shim.mjs"
        "--require",
        "unit-http/require_shim",
        "app.js"
    ]
}

Usage on Node 14.15.x and lower:
{
    "type": "external",
    "processes": {"spare": 0},
    "working_directory": '/project',
    "executable": "/usr/bin/env",
    "arguments": [
        "node",
        "--require",
        "unit-http/require_shim",
        "app.js"
    ]
}
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also added stubs for Server.address()
This was done to prevent crashes in some popular frameworks like express

Supports both CommonJS and the new ES Modules system syntax e.g:

app.js:
const http = require('http')

app.mjs:
import http from "http"

Usage on Node 14.16.x and higher:
{
    "type": "external",
    "processes": {"spare": 0},
    "working_directory": '/project',
    "executable": "/usr/bin/env",
    "arguments": [
        "node",
        "--loader",
        "unit-http/require_shim.mjs"
        "--require",
        "unit-http/require_shim",
        "app.js"
    ]
}

Usage on Node 14.15.x and lower:
{
    "type": "external",
    "processes": {"spare": 0},
    "working_directory": '/project',
    "executable": "/usr/bin/env",
    "arguments": [
        "node",
        "--require",
        "unit-http/require_shim",
        "app.js"
    ]
}
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: Node.js websockets.</title>
<updated>2019-08-22T12:33:41+00:00</updated>
<author>
<name>Andrey Zelenkov</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2019-08-22T12:33:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=9bbf54e23e185e94054072fff2673f6f5cd203e9'/>
<id>9bbf54e23e185e94054072fff2673f6f5cd203e9</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: returning "this" from writeHead() to allow chaining.</title>
<updated>2019-08-06T13:24:11+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-08-06T13:24:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=7fd9444728e1e509630f5ba0f50e7f9da150369c'/>
<id>7fd9444728e1e509630f5ba0f50e7f9da150369c</id>
<content type='text'>
In Node.js version 11.10.0 and later, the writeHead() function returns "this".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Node.js version 11.10.0 and later, the writeHead() function returns "this".
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: using low-case header names in Node.js tests.</title>
<updated>2019-04-18T16:27:12+00:00</updated>
<author>
<name>Andrey Zelenkov</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2019-04-18T16:27:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=0c12afbf6a591c54236331219770836c931abf45'/>
<id>0c12afbf6a591c54236331219770836c931abf45</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: test_node_application_write_before_writeHead reworked.</title>
<updated>2018-12-25T13:35:35+00:00</updated>
<author>
<name>Andrey Zelenkov</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2018-12-25T13:35:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=d625691ff45bd6f352a504694629af2407a7d1a1'/>
<id>d625691ff45bd6f352a504694629af2407a7d1a1</id>
<content type='text'>
Added res.end() call in application and response status check.
Also, renamed to test_node_application_write_before_write_head.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added res.end() call in application and response status check.
Also, renamed to test_node_application_write_before_write_head.
</pre>
</div>
</content>
</entry>
</feed>
