You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
closeseggjs/egg#5365
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added reusePort support to allow multiple sockets to listen on the
same port where supported.
* **Improvements**
* Improved agent startup error handling and clearer debug logs.
* CI now tests Node.js 24; package metadata and project links updated;
version bumped.
* **Tests**
* Added unit/integration and cluster tests exercising reusePort and
related startup flows.
* **Documentation**
* README updated with reusePort details.
* **Other**
* .gitignore updated.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: MK (fengmk2) <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
| reusePort |`Boolean`| (Required Node.js >= 22.12.0) allows multiple sockets on the same host to bind to the same port. Incoming connections are distributed by the operating system to listening sockets. This option is available only on some platforms, such as Linux 3.9+, DragonFlyBSD 3.6+, FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+. **Default:**`false`|
56
57
| debugPort |`Number`| the debug port only listen on http protocol |
57
58
| https |`Object`| start a https server, note: `key` / `cert` / `ca` should be full path to file |
58
59
| require |`Array\|String`| will inject into worker/agent process |
59
60
| pidFile |`String`| will save master pid to this file |
60
61
| startMode |`String`| default is 'process', use 'worker_threads' to start the app & agent worker by worker_threads |
61
-
| ports |`Array`| startup port of each app worker, such as: [7001, 7002, 7003], only effects when the startMode is 'worker_threads' |
62
+
| ports |`Array`| startup port of each app worker, such as: [7001, 7002, 7003], only effects when the `startMode` is `'worker_threads'` and `reusePort` is `false`|
62
63
| env |`String`| custom env, default is process.env.EGG_SERVER_ENV |
Copy file name to clipboardExpand all lines: lib/master.js
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ class Master extends EventEmitter {
34
34
* - {Object} [plugins] - customized plugins, for unittest
35
35
* - {Number} [workers] numbers of app workers, default to `os.cpus().length`
36
36
* - {Number} [port] listening port, default to 7001(http) or 8443(https)
37
+
* - {Boolean} [reusePort] setting `reusePort` to `true` allows multiple sockets on the same host to bind to the same port. Incoming connections are distributed by the operating system to listening sockets. This option is available only on some platforms, such as Linux 3.9+, DragonFlyBSD 3.6+, FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+. **Default:** `false`.
37
38
* - {Number} [debugPort] listening a debug port on http protocol
38
39
* - {Object} [https] https options, { key, cert, ca }, full path
39
40
* - {Array|String} [require] will inject into worker/agent process
0 commit comments