NodeOPCUA API Documentation
    Preparing search index...

    Interface OPCUAServerOptions

    interface OPCUAServerOptions {
        advertisedEndpoints?: AdvertisedEndpoint | AdvertisedEndpoint[];
        allowAnonymous?: boolean;
        alternateEndpoints?: OPCUAServerEndpointOptions[];
        alternateHostname?: string | string[];
        buildInfo?: {
            buildDate?: Date;
            buildNumber?: string;
            manufacturerName?: string;
            productName?: string;
            productUri?: string | null;
            softwareVersion?: string;
        };
        capabilitiesForMDNS?: string[];
        certificateFile?: string;
        certificateKeyPairProvider?: ICertificateKeyPairProvider;
        defaultSecureTokenLifetime?: number;
        disableDiscovery?: boolean;
        discoveryServerEndpointUrl?: string;
        endpoints?: OPCUAServerEndpointOptions[];
        host?: string;
        hostname?: string;
        isAuditing?: boolean;
        maxAllowedSessionNumber?: number;
        maxConnectionsPerEndpoint?: number;
        nodeset_filename?: string
        | string[];
        onCreateMonitoredItem?: CreateMonitoredItemHook;
        onDeleteMonitoredItem?: DeleteMonitoredItemHook;
        port?: number;
        privateKeyFile?: string;
        registerServerMethod?: RegisterServerMethod;
        resourcePath?: string;
        securityModes?: MessageSecurityMode[];
        securityPolicies?: SecurityPolicy[];
        serverCapabilities?: Partial<IServerCapabilities>;
        serverCertificateManager?: OPCUACertificateManager;
        serverInfo?: ApplicationDescriptionOptions;
        skipOwnNamespace?: boolean;
        timeout?: number;
        transportSettings?: IServerTransportSettings;
        userCertificateManager?: OPCUACertificateManager;
        userManager?: UserManagerOptions;
    }

    Hierarchy (View Summary)

    Index

    Properties

    advertisedEndpoints?: AdvertisedEndpoint | AdvertisedEndpoint[]

    Additional endpoint URL(s) to advertise.

    Use when the server is behind Docker port-mapping, a reverse proxy, or a NAT gateway. Each URL is parsed to extract hostname and port. Each entry can be a plain URL string (inherits all security settings from the main endpoint) or an AdvertisedEndpointConfig object with per-URL overrides. The server still listens on port.

    "opc.tcp://localhost:48481"
    
    ["opc.tcp://localhost:48481", { url: "opc.tcp://public:4840", securityModes: [MessageSecurityMode.SignAndEncrypt] }]
    
    allowAnonymous?: boolean

    tells if the server default endpoints should allow anonymous connection.

    true
    
    alternateEndpoints?: OPCUAServerEndpointOptions[]
    alternateHostname?: string | string[]

    alternate hostname or IP to use

    buildInfo?: {
        buildDate?: Date;
        buildNumber?: string;
        manufacturerName?: string;
        productName?: string;
        productUri?: string | null;
        softwareVersion?: string;
    }
    capabilitiesForMDNS?: string[]

    supported server capabilities for the Multicast (mDNS)

    ["NA"]
    the possible values are any of node-opcua-discovery.serverCapabilities)
    certificateFile?: string

    the server certificate full path filename

    the certificate should be in PEM format

    certificateKeyPairProvider?: ICertificateKeyPairProvider

    Optional pre-built certificate + private-key provider. When supplied, OPCUASecureObject.getCertificate() / .getCertificateChain() / .getPrivateKey() delegate to this object verbatim, and the disk-backed path (fs.existsSync + readCertificateChain + readPrivateKey) is not used.

    Intended for browser builds (bundled via esbuild) and test fixtures that want to stage a cert+key pair without staging PKI folders on disk.

    When present, certificateFile / privateKeyFile become optional and may be omitted. When absent, those two fields remain required strings and a DiskCertificateKeyPairProvider is created automatically.

    defaultSecureTokenLifetime?: number

    the default secure token life time in ms.

    disableDiscovery?: boolean

    true, if discovery service on secure channel shall be disabled

    discoveryServerEndpointUrl?: string
    "opc.tcp://localhost:4840"]
    
    host?: string

    Host IP address or hostname where the TCP server listens for connections. If omitted, defaults to listening on all network interfaces:

    • Unspecified IPv6 address (::) if IPv6 is available,
    • Unspecified IPv4 address (0.0.0.0) otherwise. Use this to bind the server to a specific interface or IP.
    hostname?: string

    the primary hostname of the endpoint.

    getFullyQualifiedDomainName()
    
    isAuditing?: boolean

    if server shall raise AuditingEvent

    true
    
    maxAllowedSessionNumber?: number

    the maximum number of simultaneous sessions allowed.

    10
    

    use serverCapabilities: { maxSessions: } instead

    maxConnectionsPerEndpoint?: number

    the maximum number authorized simultaneous connections per endpoint

    10
    
    nodeset_filename?: string | string[]

    the nodeset.xml file(s) to load

    node-opcua comes with pre-installed node-set files that can be used

    example:

    import { nodesets } from "node-opcua-nodesets";
    const server = new OPCUAServer({
    nodeset_filename: [
    nodesets.standard,
    nodesets.di,
    nodesets.adi,
    nodesets.machinery,
    ],
    });
    onCreateMonitoredItem?: CreateMonitoredItemHook
    onDeleteMonitoredItem?: DeleteMonitoredItemHook
    port?: number

    the TCP port to listen to.

    26543
    
    privateKeyFile?: string

    the server private key full path filename

    This file should contains the private key that has been used to generate the server certificate file.

    the private key should be in PEM format

    registerServerMethod?: RegisterServerMethod

    strategy used by the server to declare itself to a discovery server

    • HIDDEN: the server doesn't expose itself to the external world
    • MDNS: the server publish itself to the mDNS Multicast network directly
    • LDS: the server registers itself to the LDS or LDS-ME (Local Discovery Server)
    .HIDDEN - by default the server
    will not register itself to the local discovery server
    resourcePath?: string

    resource Path is a string added at the end of the url such as "/UA/Server"

    securityModes?: MessageSecurityMode[]

    the possible security mode that the server will expose

    [MessageSecurityMode.None, MessageSecurityMode.Sign, MessageSecurityMode.SignAndEncrypt]
    
    securityPolicies?: SecurityPolicy[]

    the possible security policies that the server will expose

    [SecurityPolicy.None, SecurityPolicy.Basic128Rsa15, SecurityPolicy.Basic256Sha256, SecurityPolicy.Aes128_Sha256_RsaOaep, SecurityPolicy.Aes256_Sha256_RsaPss  ]
    
    serverCapabilities?: Partial<IServerCapabilities>
    serverCertificateManager?: OPCUACertificateManager

    Server Certificate Manager

    this certificate manager will be used by the server to access and store certificates from the connecting clients

    the server Info

    this object contains the value that will populate the Root/ObjectS/Server/ServerInfo OPCUA object in the address space.

    skipOwnNamespace?: boolean

    skipOwnNamespace to true, if you don't want the server to create a dedicated namespace for its own (namespace=1). Use this flag if you intend to load the server own namespace from an external source.

    false
    
    timeout?: number

    the HEL/ACK transaction timeout in ms.

    Use a large value ( i.e 15000 ms) for slow connections or embedded devices.

    10000
    
    transportSettings?: IServerTransportSettings
    userCertificateManager?: OPCUACertificateManager

    user Certificate Manager this certificate manager holds the X509 certificates used by client that uses X509 certificate token to impersonate a user

    userManager?: UserManagerOptions

    an object that implements user authentication methods