-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
1,314 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) 2017-2022 Cloudflare, Inc. | ||
// Licensed under the Apache 2.0 license found in the LICENSE file or at: | ||
// https://opensource.org/licenses/Apache-2.0 | ||
|
||
// This file is used as a sidecar for the net-nodejs-test tests. | ||
// It creates 2 TCP servers to act as a source of truth for the node:net tests. | ||
// We execute this command using Node.js, which makes net.createServer available. | ||
const net = require('node:net'); | ||
|
||
const server = net.createServer((s) => { | ||
s.on('error', (err) => { | ||
// Required for process to not crash. | ||
console.error(err); | ||
}); | ||
s.end(); | ||
}); | ||
server.listen(9999, () => console.info('Listening on port 9999')); | ||
|
||
const echoServer = net.createServer((s) => { | ||
s.on('error', (err) => { | ||
// Required for process to not crash. | ||
console.error(err); | ||
}); | ||
s.pipe(s); | ||
}); | ||
echoServer.listen(9998, () => console.info('Listening on port 9998')); |
Oops, something went wrong.