Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
serverInfo.productUri = serverInfo.productUri || "SampleDiscoveryServer";
serverInfo.applicationName = serverInfo.applicationName || {text: "SampleDiscoveryServer", locale: null};
serverInfo.gatewayServerUri = serverInfo.gatewayServerUri || "";
serverInfo.discoveryProfileUri = serverInfo.discoveryProfileUri || "";
serverInfo.discoveryUrls = serverInfo.discoveryUrls || [];
this.serverInfo = serverInfo;
const port = options.port || 4840;
this.capabilitiesForMDNS = ["LDS"];
this.registered_servers = {};
// see OPC UA Spec 1.2 part 6 : 7.4 Well Known Addresses
// opc.tcp://localhost:4840/UADiscovery
const endPoint = new OPCUAServerEndPoint({
port: port,
certificateChain: this.getCertificateChain(),
privateKey: this.getPrivateKey(),
serverInfo: this.serverInfo
});
endPoint.addStandardEndpointDescriptions();
this.endpoints.push(endPoint);
endPoint.on("message", (message, channel) => {
this.on_request(message, channel);
});
this.mDnsResponder = null;
}
this._delayInit = () => {
const endPoint = new OPCUAServerEndPoint({
port,
certificateChain: this.getCertificateChain(),
certificateManager: this.serverCertificateManager,
privateKey: this.getPrivateKey(),
serverInfo: this.serverInfo
});
endPoint.addStandardEndpointDescriptions();
this.endpoints.push(endPoint);
endPoint.on("message", (message: Message, channel: ServerSecureChannelLayer) => {
if (doDebug) {
debugLog(" RECEIVE MESSAGE", message.request.constructor.name);