node-red-contrib-opcua-server-refresh 0.2.5

Fork of the original 'node-red-contrib-opcua-server' package that is no longer maintained. This has been refactored to support the latest version of node-opcua and fixes incomplete/non-working features.

npm install node-red-contrib-opcua-server-refresh

node-red-contrib-opcua-server-refresh

A modern, secure, and TypeScript-powered OPC UA server for Node-RED based on the latest node-opcua library.

npm version Build Status License: MIT

๐ŸŽ‰ Major Release Updates

This release represents a complete modernization of the OPC UA server with significant improvements in security, reliability, and developer experience.

๐Ÿš€ What's New

  • ๐Ÿ”ง Complete TypeScript Migration: Full type safety and enhanced developer experience
  • ๐Ÿ”’ Critical Security Fixes: Eliminated vulnerabilities with secure direct execution
  • โšก Stable node-opcua Support: Updated to stable version 2.154.0 with full compatibility
  • โœ… Comprehensive Testing: 61 tests with 100% pass rate ensuring reliability
  • ๐Ÿ—๏ธ Modern Architecture: Modular design with enhanced error handling

๐Ÿ“– About

NOTE: This is a fork and modernization of the original node-red-contrib-opcua-server by Klaus Landsdorf, which has not been maintained for over 2 years. This updated version was created by Richard Meyer to work with the latest versions of node-opcua and its dependencies, while fixing broken/incomplete features from the original project.

Key Improvements Over Original

  • โœ… Loading of nodeset XML files from inside the node configuration
  • โœ… Full OPC UA security policy support with modern implementations
  • โœ… TypeScript support for better development experience
  • โœ… Comprehensive test suite ensuring reliability
  • โœ… Latest dependencies with active maintenance

๐Ÿ”’ Security Enhancements

Critical Vulnerability Fixes

This version eliminates critical security vulnerabilities present in the original package:

  • CVE-2023-29017 & CVE-2023-30547: Replaced vulnerable vm2 library with secure direct execution
  • Enhanced Security: Prototype pollution protection and input validation
  • Secure Script Execution: Timeout limits and enhanced error handling
  • Modern Security Practices: Following Node.js security best practices

๐Ÿ—๏ธ Core Technology

  • Direct Execution: Secure script execution replacing vulnerable vm2
  • node-opcua 2.154.0: Stable generation OPC UA library from Etienne Rossignon
  • TypeScript: Full type safety and enhanced development experience
  • Comprehensive Testing: 61 tests covering all functionality

๐Ÿ“ฆ Installation

Run the following command in your Node-RED user directory - typically ~/.node-red:

npm install node-red-contrib-opcua-server-refresh

Build from Source (if needed)

If you encounter installation issues, try these options:

npm install node-red-contrib-opcua-server-refresh --unsafe-perm --build-from-source

๐Ÿš€ Quick Getting Started

Basic Setup

  1. Add the OPC UA Server node to your Node-RED flow
  2. Configure the endpoint: Set the endpoint URL (default: opc.tcp://localhost:54840)
  3. Deploy your flow: The server will start automatically

Default Configuration

A detailed example server is included with pre-populated address space nodes deployed in various formats. If you use the default port 54840, simply define the endpoint URL in the format:

opc.tcp://<node-red-ip>:54840

Screenshot of endpoint configuration

Testing Your Server

We recommend Prosys OPC UA Browser for testing:

  1. Install an OPC UA client (Prosys is free with email registration)
  2. Connect to your endpoint using the URL above
  3. Set security to "None" for initial testing (anonymous login)
  4. Browse the Objects folder to see your data

Screenshot of client browser

๐Ÿ”ง Advanced Configuration

Loading Nodeset XML Files

Navigate to the Users & Sets tab and enter the absolute path to your nodeset XML file.

Pre-included Nodesets: This package includes nodesets in src/public/nodesets/. Example path:

/root/.node-red/node_modules/node-red-contrib-opcua-server-refresh/src/public/nodesets/Opc.Ua.AutoID.NodeSet2.xml

Validation: Successfully loaded nodesets appear in Types โ†’ DataTypes โ†’ XML Schema in your OPC UA client.

Screenshot of nodeset loading

TypeScript Development

For developers working with TypeScript:

# Development build with source maps
npm run build:dev

# Watch mode for development
npm run watch

# Production build
npm run build:ts

Security Configuration

  • Anonymous Access: Enabled by default for easy setup
  • User Authentication: Configure in the Users & Sets tab
  • Certificate Security: Specify certificate paths for secure connections
  • Security Policies: Support for modern OPC UA security standards

๐Ÿ“š Detailed Guides

For comprehensive setup guides, see our detailed tutorials:

๐Ÿ“‹ Examples

Example projects are provided in the examples folder:

Simply copy the JSON and import into your Node-RED flows.

๐Ÿ› Debug & Troubleshooting

Verbose Logging

Enable debug logging for detailed information:

DEBUG=opcuaCompact* node-red -v 1>Node-RED-OPC-UA-Server.log 2>&1

Common Issues

  • "Cannot read properties of null": Check nodeset file path is correct
  • Connection refused: Verify endpoint URL and port availability
  • Security errors: Ensure security settings match between client and server

๐Ÿงช Testing

This package includes comprehensive testing:

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Clear test cache
npm run test:clearCache

Test Coverage: 61 tests covering all functionality with 100% pass rate.

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js 20+
  • TypeScript 4.7+
  • npm or yarn

Development Workflow

# Install dependencies
npm install

# TypeScript development build
npm run build:dev

# Watch mode for development
npm run watch

# Run tests
npm test

# Format code
npm run clean:formatter

Code Style

This project uses Prettier for code formatting. All TypeScript files are automatically formatted on build.

๐Ÿ“„ License

MIT License - Based on the original work by Bianco Royal Software Innovationsยฎ

Copyright (c) 2019 Bianco Royal Software Innovationsยฎ
Forked and modernized by Richard Meyer 2025

๐Ÿค Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

๐Ÿ“ž Support

Node Info

Version: 0.2.5
Updated 1 week, 4 days ago
License: MIT
Rating: 5.0 1

Categories

Actions

Rate:

Downloads

25 in the last week

Nodes

  • opcua-compact-server-refresh

Keywords

  • node-red
  • opcua-server
  • automation
  • iiot
  • biancoroyal

Maintainers