mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
refactor(ext/http): bring back 'reusePort' option for 'Deno.serve()' (#18590)
Closes https://github.com/denoland/deno/issues/18582
This commit is contained in:
parent
a1764f7690
commit
c4628aa809
2 changed files with 4 additions and 1 deletions
|
@ -946,6 +946,7 @@ Deno.test(
|
|||
signal: ac.signal,
|
||||
onListen: onListen(listeningPromise),
|
||||
onError: createOnErrorCb(ac),
|
||||
reusePort: true,
|
||||
});
|
||||
|
||||
await listeningPromise;
|
||||
|
|
|
@ -657,7 +657,7 @@ async function serve(arg1, arg2) {
|
|||
const listenOpts = {
|
||||
hostname: options.hostname ?? "127.0.0.1",
|
||||
port: options.port ?? 9000,
|
||||
reuseport: options.reusePort ?? false,
|
||||
reusePort: options.reusePort ?? false,
|
||||
};
|
||||
|
||||
if (options.cert || options.key) {
|
||||
|
@ -677,11 +677,13 @@ async function serve(arg1, arg2) {
|
|||
port: listenOpts.port,
|
||||
cert: listenOpts.cert,
|
||||
key: listenOpts.key,
|
||||
reusePort: listenOpts.reusePort,
|
||||
});
|
||||
} else {
|
||||
listener = listen({
|
||||
hostname: listenOpts.hostname,
|
||||
port: listenOpts.port,
|
||||
reusePort: listenOpts.reusePort,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue