Node.js module

net

The 'node:net' module provides an asynchronous network API for creating TCP servers and clients. It exposes Socket and Server classes for handling raw network connections.

Works in Bun · notes

Core TCP socket functionality works. The SocketAddress class is implemented internally but not exposed. BlockList exists but is currently a no-op.

Functions 10

Classes 5

  • class net.BlockList

    The BlockList object can be used with some network APIs to specify rules for disabling inbound or outbound access to specific IP addresses, IP ranges, or

  • class net.BoundSocket

    Allows for the synchronous creation of a pre-bound socket, that can be passed to listen() or new net.Socket() later on.

  • class net.Server

    This class is used to create a TCP or IPC server.

  • class net.Socket

    This class is an abstraction of a TCP socket or a streaming IPC endpoint (uses named pipes on Windows, and Unix domain sockets otherwise).

  • class net.SocketAddress

Interfaces 15

Types 5