Core nodes collection for Node-RED runtime providing fundamental building blocks for visual programming flows
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Network nodes provide comprehensive communication capabilities supporting HTTP servers and clients, MQTT messaging, WebSocket connections, and TCP/UDP protocols. These nodes enable Node-RED flows to interact with web services, IoT devices, and network-based systems.
Create HTTP server endpoints that can receive requests and send responses.
/**
* HTTP In node - creates HTTP server endpoints
* Registers as node type: "http in"
*/
function HTTPInNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.url - URL path pattern (e.g., "/api/data/:id")
// config.method - HTTP method: "get", "post", "put", "patch", "delete"
// config.upload - Handle file uploads
// config.swaggerDoc - Swagger documentation
}
/**
* HTTP Response node - sends HTTP responses
* Registers as node type: "http response"
*/
function HTTPResponseNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.statusCode - HTTP status code
// config.headers - Response headers object
}Usage Examples:
// REST API endpoint
{
"id": "http-in-1",
"type": "http in",
"url": "/api/users/:id",
"method": "get"
}
// POST endpoint with file upload
{
"type": "http in",
"url": "/upload",
"method": "post",
"upload": true
}
// HTTP response configuration
{
"type": "http response",
"statusCode": "200",
"headers": {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*"
}
}Make HTTP requests to external services with full configuration options.
/**
* HTTP Request node - makes HTTP client requests
* Registers as node type: "http request"
*/
function HTTPRequestNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.method - HTTP method: "GET", "POST", "PUT", "DELETE", etc.
// config.ret - Return type: "txt", "bin", "obj"
// config.paytoqs - Send payload as query string
// config.url - Target URL
// config.tls - TLS configuration node ID
// config.proxy - HTTP proxy configuration node ID
// config.authType - Authentication type: "basic", "digest", "bearer"
// config.senderr - Send error responses
}Usage Examples:
// GET request
{
"method": "GET",
"url": "https://api.example.com/data",
"ret": "obj"
}
// POST with authentication
{
"method": "POST",
"url": "https://api.example.com/users",
"authType": "bearer",
"ret": "obj"
}MQTT messaging support for IoT and event-driven communication.
/**
* MQTT In node - subscribes to MQTT topics
* Registers as node type: "mqtt in"
*/
function MqttInNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.topic - MQTT topic to subscribe to
// config.qos - Quality of Service level (0, 1, 2)
// config.datatype - Data type: "auto", "buffer", "utf8", "json"
// config.broker - MQTT broker configuration node ID
}
/**
* MQTT Out node - publishes to MQTT topics
* Registers as node type: "mqtt out"
*/
function MqttOutNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.topic - MQTT topic to publish to
// config.qos - Quality of Service level
// config.retain - Retain message flag
// config.broker - MQTT broker configuration node ID
}
/**
* MQTT Broker configuration node
* Registers as node type: "mqtt-broker"
*/
function MqttBrokerNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.broker - Broker hostname/IP
// config.port - Broker port (default 1883)
// config.tls - TLS configuration node ID
// config.clientid - MQTT client ID
// config.keepalive - Keep alive interval
// config.cleansession - Clean session flag
// config.username - Authentication username
// config.password - Authentication password
}Usage Examples:
// MQTT broker configuration
{
"type": "mqtt-broker",
"broker": "mqtt.example.com",
"port": "1883",
"clientid": "node-red-client",
"keepalive": "60",
"cleansession": true
}
// MQTT subscriber
{
"type": "mqtt in",
"topic": "sensors/temperature/+",
"qos": "1",
"datatype": "json",
"broker": "broker-id"
}
// MQTT publisher
{
"type": "mqtt out",
"topic": "actuators/relay1",
"qos": "0",
"retain": false,
"broker": "broker-id"
}WebSocket communication for real-time bidirectional messaging.
/**
* WebSocket In node - receives WebSocket messages
* Registers as node type: "websocket in"
*/
function WebSocketInNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.path - WebSocket path (for server mode)
// config.wholemsg - Send whole message or just payload
// config.client - WebSocket client configuration node ID
}
/**
* WebSocket Out node - sends WebSocket messages
* Registers as node type: "websocket out"
*/
function WebSocketOutNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.path - WebSocket path
// config.client - WebSocket client configuration node ID
}
/**
* WebSocket Listener configuration node - WebSocket server configuration
* Registers as node type: "websocket-listener"
*/
function WebSocketListenerNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.path - WebSocket server path
// config.wholemsg - Send whole message or just payload
}
/**
* WebSocket Client configuration node - WebSocket client connection settings
* Registers as node type: "websocket-client"
*/
function WebSocketClientNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.path - WebSocket server URL
// config.wholemsg - Send whole message or just payload
// config.subprotocol - WebSocket subprotocol
// config.hb - Heartbeat interval
// config.proxy - HTTP proxy configuration
}TCP client and server functionality for direct socket communication.
/**
* TCP In node - TCP server or client receiver
* Registers as node type: "tcp in"
*/
function TcpInNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.port - Port number (for server mode)
// config.host - Host address (for client mode)
// config.datamode - Data mode: "stream", "single"
// config.newline - Line separator character
// config.topic - Message topic
// config.trim - Trim whitespace
// config.base64 - Base64 decode incoming data
}
/**
* TCP Out node - TCP client sender
* Registers as node type: "tcp out"
*/
function TcpOutNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.host - Target host
// config.port - Target port
// config.beserver - Act as server
// config.base64 - Base64 encode outgoing data
// config.end - Close connection after send
}
/**
* TCP Request node - TCP request/response client
* Registers as node type: "tcp request"
*/
function TcpRequestNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.server - Target server
// config.port - Target port
// config.out - Output type: "time", "char", "count"
// config.splitc - Split character
// config.timeout - Request timeout
}UDP communication for connectionless messaging.
/**
* UDP In node - receives UDP messages
* Registers as node type: "udp in"
*/
function UdpInNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.port - UDP port to listen on
// config.bind - Bind address
// config.multicast - Multicast group address
// config.group - Multicast group
// config.datatype - Data type: "utf8", "buffer"
// config.iface - Network interface
}
/**
* UDP Out node - sends UDP messages
* Registers as node type: "udp out"
*/
function UdpOutNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.addr - Target address
// config.port - Target port
// config.iface - Network interface
// config.multicast - Multicast mode
// config.outport - Source port
}
// HTTP endpoint for UDP port information
// GET /udp-ports/:id - Get UDP port details for nodeUsage Examples:
// UDP listener
{
"type": "udp in",
"port": "1234",
"bind": "0.0.0.0",
"datatype": "utf8"
}
// UDP sender
{
"type": "udp out",
"addr": "192.168.1.100",
"port": "5678"
}
// UDP multicast receiver
{
"type": "udp in",
"port": "1234",
"multicast": "true",
"group": "224.0.0.1"
}Network nodes use configuration nodes for shared settings.
/**
* TLS Config node - SSL/TLS certificate configuration
* Registers as node type: "tls-config"
*/
function TLSConfigNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.cert - Client certificate
// config.key - Private key
// config.ca - Certificate Authority
// config.certname - Certificate file name
// config.keyname - Key file name
// config.caname - CA file name
// config.servername - Server name for SNI
// config.verifyservercert - Verify server certificate
}/**
* HTTP Proxy node - proxy configuration for HTTP requests
* Registers as node type: "http proxy"
*/
function HttpProxyNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.url - Proxy URL
// config.username - Proxy username
// config.password - Proxy password
}Network nodes handle various message patterns:
// HTTP In message structure
interface HttpInMessage {
payload: any; // Request body
req: { // HTTP request object
params: object; // URL parameters
query: object; // Query parameters
headers: object; // Request headers
method: string; // HTTP method
url: string; // Request URL
cookies: object; // Request cookies
};
res: object; // HTTP response object (for response node)
}
// MQTT message structure
interface MqttMessage {
payload: any; // Message payload
topic: string; // MQTT topic
qos: number; // Quality of Service
retain: boolean; // Retain flag
}
// TCP/UDP message structure
interface NetworkMessage {
payload: any; // Message data
ip: string; // Source/destination IP
port: number; // Source/destination port
}HTTP nodes support various authentication methods:
// Basic authentication
{
"authType": "basic",
"user": "username",
"password": "password"
}
// Bearer token authentication
{
"authType": "bearer",
"token": "access_token"
}
// Digest authentication
{
"authType": "digest",
"user": "username",
"password": "password"
}