Download the PHP package php-opcua/opcua-client-ext-transport-pubsub without Composer

On this page you can find all versions of the php package php-opcua/opcua-client-ext-transport-pubsub. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package opcua-client-ext-transport-pubsub

OPC UA PubSub Subscriber for PHP

Tests Coverage Latest Version PHP Version

Linux macOS Windows


Subscribe to OPC UA PubSub streams directly from PHP — UDP unicast or multicast, UADP and JSON payloads, group-key security — without any C/C++ extensions, HTTP gateways, or middleware in between.

This package extends php-opcua/opcua-client with the OPC UA Part 14 — PubSub Subscriber role. The core client stays unchanged; installing this extension only adds the PhpOpcua\Client\ExtTransportPubSub\* namespace. Same zero-dependency philosophy, same PSR-3 / PSR-14 integration, same cross-platform support.

What you can do with it:

All this with ext-sockets as the only extension beyond the core's ext-openssl, and PHP 8.2 through 8.5 supported on Linux, macOS, and Windows.

Note: PubSub is a fire-and-forget broadcast paradigm, not a session-oriented protocol. A long-running worker process (ReactPHP, Symfony Messenger, Laravel queue worker, Artisan command, systemd unit) is the natural place to run a Subscriber. Short-lived PHP requests cannot sustain a meaningful subscription window.

### Ships as an extension, not as a replacement The core `php-opcua/opcua-client` is a tight, zero-dependency library focused on client/server OPC UA. PubSub has a different runtime model (event loop vs request/response), a different wire protocol (UADP), and different security (pre-shared group keys vs per-session asymmetric handshake). Bundling it into the core would inflate the base install for the 95% of users who only need read/write/browse/subscribe. This package is purely additive. Nothing in the core changes when you `composer require` it.

Quick Start

That's it. Build, configure one reader, block on run(). Press Ctrl-C (or call stop() from a signal handler) to exit cleanly.

Tip: Prefer poll(timeoutMs: 500) over run() when you have your own event loop (ReactPHP, Amp, custom). It returns the batch of decoded DataSetMessage objects from this tick without blocking past the timeout.

See It in Action

Listen on unicast UDP

Tune the UDP socket

Decode JSON payloads

Load metadata from JSON, XML, or a live server

Secure the stream with pre-shared keys

Rotate keys from a Security Key Service

Poll instead of run

Graceful shutdown from a signal handler

Receive PSR-14 events for every step

Listeners fire for NetworkMessageReceived, DataSetMessageReceived, DataSetFieldReceived, MessageDecodeError, SecurityValidationFailed, TransportOpened, TransportClosed, and TransportError. Zero overhead when no dispatcher is configured.

Add structured logging

Any PSR-3 logger works. Without one, logging is silently disabled.

Plug in your own transport

The PubSubTransportInterface contract is the extension point that keeps the subscriber agnostic to the underlying transport. External packages like php-opcua/opcua-client-ext-mqtt plug in by implementing this interface.

Why This Package?

Features

Feature What it does
UDP Transport Unicast and IPv4 multicast with MCAST_JOIN_GROUP (legacy fallback), SO_REUSEADDR, non-blocking sockets, socket_select timeout
UADP Codec Binary PubSub encoding — PublisherId (Byte/UInt16/UInt32/UInt64/String), GroupHeader, PayloadHeader with multiple DataSetMessages, Variant / RawData / DataValue field encodings
JSON Codec Reversible JSON encoding from Part 14 §7.2 (encode + decode, no external metadata required)
Subscriber Runtime Event loop over N transports, demux by (publisherId, writerGroupId, dataSetWriterId), blocking run() and non-blocking poll()
Security Sign (HMAC-SHA256) and SignAndEncrypt (AES-256-CBC) with pre-shared keys via StaticGroupKeyProvider or SKS-backed rotation via SksGroupKeyProvider
Metadata Loaders DataSetMetaData::fromArray(), fromJsonFile(), fromXmlFile(), fromXmlString(), fromBinary(), fetchFromServer()
PSR-14 Events NetworkMessageReceived, DataSetMessageReceived, DataSetFieldReceived, MessageDecodeError, SecurityValidationFailed, TransportOpened, TransportClosed, TransportError
PSR-3 Logging Any PSR-3 logger plugs in. NullLogger by default.
Pluggable Transports PubSubTransportInterface is the stable hook point for third-party transports (e.g. MQTT)
Module System PubSubModule base class lets you extend the kernel with custom behaviour (telemetry, alarm forwarding, ...)
Typed DTOs public readonly properties everywhere — NetworkMessage, DataSetMessage, DataSetField, FieldMetaData, DataSetMetaData, DataSetReaderConfig, UdpOptions, ReceivedPayload, PubSubSecurityOptions

Documentation

Full docs live under https://www.php-opcua.com/documentation/opcua-client-ext-transport-pubsub).

Document Covers
Overview What it is, when to use it, what ships
Quick start Reader + callback + listen, in three steps
How it works The transport → codec → security → kernel pipeline
Encodings UADP and JSON, field encodings
Subscriber & builder Builder, run() / poll() / stop(), lifecycle
Transports UDP configuration, multicast, custom transports
Readers & metadata DataSetReaderConfig, loading DataSetMetaData
Events Custom kernel hooks; the 8 PSR-14 events
Group-key security Sign, SignAndEncrypt, static keys, SKS rotation
Exceptions Fake transport + dispatcher; error reference

Testing

Run ./vendor/bin/pest after composer install. Unit tests cover codec round-trips, UDP loopback send/receive, kernel demux, security unwrap, metadata loaders, and SKS key fetching. CI runs on PHP 8.2, 8.3, 8.4, and 8.5 across Linux, macOS, and Windows via GitHub Actions.

Ecosystem

Package Description
opcua-client Pure PHP OPC UA client (required)
opcua-client-ext-transport-pubsub OPC UA PubSub Subscriber (this package)
opcua-client-nodeset Pre-generated PHP types from OPC Foundation companion specifications
opcua-session-manager Daemon-based session persistence for the classic client
laravel-opcua Laravel integration for the classic client
opcua-cli CLI tool — browse, read, write, watch, manage certificates

Community

Have questions, ideas, or want to share what you've built? Join the GitHub Discussions.

Connected a PubSub-capable device? We're collecting a community-driven list of tested publishers. Share your experience — even a one-liner like "open62541 1.4, UDP multicast, works fine" helps other users know what to expect.

AI-Ready

This package ships with machine-readable documentation designed for AI coding assistants (Claude, Cursor, Copilot, ChatGPT, and others). Feed these files to your AI so it knows how to use the library correctly:

File Purpose
llms.txt Compact project summary — architecture, key classes, API signatures
llms-full.txt Comprehensive technical reference — every class, DTO, encoding detail
llms-skills.md Task-oriented recipes — step-by-step instructions for common tasks

How to use: copy the files you need into your project's AI configuration directory. The files are located in vendor/php-opcua/opcua-client-ext-transport-pubsub/ after composer install.

Roadmap

See ROADMAP.md for what's coming next.

Contributing

Contributions welcome — see CONTRIBUTING.md.

Changelog

See CHANGELOG.md.

License

MIT


All versions of opcua-client-ext-transport-pubsub with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-sockets Version *
php-opcua/opcua-client Version ^4.4@dev|dev-master
psr/log Version ^3.0
psr/event-dispatcher Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package php-opcua/opcua-client-ext-transport-pubsub contains the following files

Loading the files please wait ...