File
Blob: src/node/net.ts
| 1 | // Copyright (c) 2017-2022 Cloudflare, Inc. |
| 2 | // Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | // https://opensource.org/licenses/Apache-2.0 |
| 4 | // |
| 5 | // Copyright Joyent, Inc. and other Node contributors. |
| 6 | // |
| 7 | // Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | // copy of this software and associated documentation files (the |
| 9 | // "Software"), to deal in the Software without restriction, including |
| 10 | // without limitation the rights to use, copy, modify, merge, publish, |
| 11 | // distribute, sublicense, and/or sell copies of the Software, and to permit |
| 12 | // persons to whom the Software is furnished to do so, subject to the |
| 13 | // following conditions: |
| 14 | // |
| 15 | // The above copyright notice and this permission notice shall be included |
| 16 | // in all copies or substantial portions of the Software. |
| 17 | // |
| 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN |
| 21 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 22 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 23 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
| 24 | // USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | |
| 26 | import { |
| 27 | BlockList, |
| 28 | SocketAddress, |
| 29 | Server, |
| 30 | Socket, |
| 31 | connect, |
| 32 | createConnection, |
| 33 | createServer, |
| 34 | getDefaultAutoSelectFamily, |
| 35 | setDefaultAutoSelectFamily, |
| 36 | getDefaultAutoSelectFamilyAttemptTimeout, |
| 37 | setDefaultAutoSelectFamilyAttemptTimeout, |
| 38 | isIP, |
| 39 | isIPv4, |
| 40 | isIPv6, |
| 41 | _normalizeArgs, |
| 42 | } from 'node-internal:internal_net'; |
| 43 | |
| 44 | export const Stream = Socket; |
| 45 | |
| 46 | export { |
| 47 | BlockList, |
| 48 | SocketAddress, |
| 49 | Server, |
| 50 | Socket, |
| 51 | connect, |
| 52 | createConnection, |
| 53 | createServer, |
| 54 | getDefaultAutoSelectFamily, |
| 55 | setDefaultAutoSelectFamily, |
| 56 | getDefaultAutoSelectFamilyAttemptTimeout, |
| 57 | setDefaultAutoSelectFamilyAttemptTimeout, |
| 58 | isIP, |
| 59 | isIPv4, |
| 60 | isIPv6, |
| 61 | _normalizeArgs, |
| 62 | }; |
| 63 | |
| 64 | export default { |
| 65 | BlockList, |
| 66 | SocketAddress, |
| 67 | Stream: Socket, |
| 68 | Server, |
| 69 | Socket, |
| 70 | connect, |
| 71 | createConnection, |
| 72 | createServer, |
| 73 | getDefaultAutoSelectFamily, |
| 74 | setDefaultAutoSelectFamily, |
| 75 | getDefaultAutoSelectFamilyAttemptTimeout, |
| 76 | setDefaultAutoSelectFamilyAttemptTimeout, |
| 77 | isIP, |
| 78 | isIPv4, |
| 79 | isIPv6, |
| 80 | _normalizeArgs, |
| 81 | }; |