How to use the node-opcua-service-discovery.BonjourHolder function in node-opcua-service-discovery

To help you get started, we’ve selected a few node-opcua-service-discovery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server-discovery / source / opcua_discovery_server.ts View on Github external
): Promise {

            let b = ((conf as any).bonjourHolder) as BonjourHolder;
            if (b) {
                if (sameAnnouncement(b.announcement!, announcement)) {
                    debugLog("Configuration ", conf.mdnsServerName, " has not changed !");
                    // nothing to do
                    return;
                } else {
                    debugLog("Configuration ", conf.mdnsServerName, " HAS changed !");
                    debugLog(" Was ", b.announcement!);
                    debugLog(" is  ", announcement);
                }
                await _stop_announcedOnMulticastSubnet(conf);
            }
            b = new BonjourHolder();
            ((conf as any).bonjourHolder) = b;
            await b._announcedOnMulticastSubnet(announcement);
        }
github node-opcua / node-opcua / packages / node-opcua-server-discovery / source / opcua_discovery_server.ts View on Github external
const defaultApplicationUri = makeApplicationUrn("%FQDN%", "NodeOPCUA-DiscoveryServer");

        options.serverInfo = options.serverInfo || {};
        const serverInfo = options.serverInfo;
        serverInfo.applicationType = ApplicationType.DiscoveryServer;
        serverInfo.applicationUri = serverInfo.applicationUri || defaultApplicationUri;
        serverInfo.productUri = serverInfo.productUri || "NodeOPCUA-DiscoveryServer";
        serverInfo.applicationName = serverInfo.applicationName || { text: "NodeOPCUA-DiscoveryServer", locale: null };
        serverInfo.gatewayServerUri = serverInfo.gatewayServerUri || "";
        serverInfo.discoveryProfileUri = serverInfo.discoveryProfileUri || "";
        serverInfo.discoveryUrls = serverInfo.discoveryUrls || [];

        super(options);

        this.bonjourHolder = new BonjourHolder();

        const port = options.port || 4840;

        this.capabilitiesForMDNS = ["LDS"];
        this.registeredServers = {};

        this.mDnsResponder = undefined;

        // see OPC UA Spec 1.2 part 6 : 7.4 Well Known Addresses
        // opc.tcp://localhost:4840/UADiscovery

        this._delayInit = () => {
            const endPoint = new OPCUAServerEndPoint({
                port,

                certificateChain: this.getCertificateChain(),
github node-opcua / node-opcua / packages / node-opcua-server / source / register_server_manager_mdns_only.ts View on Github external
constructor(options: any) {
        super();
        this.server = options.server;
        assert(this.server);
        assert(this.server instanceof OPCUABaseServer);
        this.bonjour = new BonjourHolder();
    }