node-opcua-server 2.102.0 → 2.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base_server.js +45 -17
- package/dist/base_server.js.map +1 -1
- package/dist/helper.js +24 -1
- package/dist/helper.js.map +1 -1
- package/dist/i_server_side_publish_engine.js +4 -1
- package/dist/i_server_side_publish_engine.js.map +1 -1
- package/dist/monitored_item.js +6 -3
- package/dist/monitored_item.js.map +1 -1
- package/dist/opcua_server.d.ts +11 -3
- package/dist/opcua_server.js +39 -13
- package/dist/opcua_server.js.map +1 -1
- package/dist/register_server_manager.js +31 -5
- package/dist/register_server_manager.js.map +1 -1
- package/dist/server_end_point.js +40 -14
- package/dist/server_end_point.js.map +1 -1
- package/dist/server_engine.js +34 -8
- package/dist/server_engine.js.map +1 -1
- package/dist/server_publish_engine.js +16 -13
- package/dist/server_publish_engine.js.map +1 -1
- package/dist/server_publish_engine_for_orphan_subscriptions.js +6 -3
- package/dist/server_publish_engine_for_orphan_subscriptions.js.map +1 -1
- package/dist/server_session.js +25 -2
- package/dist/server_session.js.map +1 -1
- package/dist/server_subscription.js +18 -15
- package/dist/server_subscription.js.map +1 -1
- package/package.json +48 -49
- package/source/base_server.ts +11 -9
- package/source/monitored_item.ts +1 -1
- package/source/opcua_server.ts +12 -4
- package/source/register_server_manager.ts +1 -1
- package/source/server_end_point.ts +29 -29
- package/source/server_engine.ts +1 -1
- package/source/server_publish_engine.ts +1 -1
- package/source/server_publish_engine_for_orphan_subscriptions.ts +1 -1
- package/source/server_subscription.ts +1 -1
package/source/opcua_server.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { EventEmitter } from "events";
|
|
|
11
11
|
import { callbackify, types } from "util";
|
|
12
12
|
|
|
13
13
|
import * as async from "async";
|
|
14
|
-
import
|
|
14
|
+
import chalk from "chalk";
|
|
15
15
|
|
|
16
16
|
import { extractFullyQualifiedDomainName, getFullyQualifiedDomainName } from "node-opcua-hostname";
|
|
17
17
|
|
|
@@ -781,7 +781,7 @@ export interface OPCUAServerOptions extends OPCUABaseServerOptions, OPCUAServerE
|
|
|
781
781
|
* the maximum number of simultaneous sessions allowed.
|
|
782
782
|
* @default 10
|
|
783
783
|
* @deprecated use serverCapabilities: { maxSessions: } instead
|
|
784
|
-
|
|
784
|
+
|
|
785
785
|
*/
|
|
786
786
|
maxAllowedSessionNumber?: number;
|
|
787
787
|
|
|
@@ -798,8 +798,16 @@ export interface OPCUAServerOptions extends OPCUABaseServerOptions, OPCUAServerE
|
|
|
798
798
|
*
|
|
799
799
|
* example:
|
|
800
800
|
*
|
|
801
|
-
* ```
|
|
802
|
-
*
|
|
801
|
+
* ```javascript
|
|
802
|
+
* import { nodesets } from "node-opcua-nodesets";
|
|
803
|
+
* const server = new OPCUAServer({
|
|
804
|
+
* nodeset_filename: [
|
|
805
|
+
* nodesets.standard,
|
|
806
|
+
* nodesets.di,
|
|
807
|
+
* nodesets.adi,
|
|
808
|
+
* nodesets.machinery,
|
|
809
|
+
* ],
|
|
810
|
+
* });
|
|
803
811
|
* ```
|
|
804
812
|
*/
|
|
805
813
|
nodeset_filename?: string[] | string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// tslint:disable:no-console
|
|
5
5
|
import { EventEmitter } from "events";
|
|
6
6
|
import * as async from "async";
|
|
7
|
-
import
|
|
7
|
+
import chalk from "chalk";
|
|
8
8
|
|
|
9
9
|
import { assert } from "node-opcua-assert";
|
|
10
10
|
import { ErrorCallback, UAString } from "node-opcua-basic-types";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { EventEmitter } from "events";
|
|
6
6
|
import * as net from "net";
|
|
7
7
|
import { Server, Socket } from "net";
|
|
8
|
-
import
|
|
8
|
+
import chalk from "chalk";
|
|
9
9
|
import * as async from "async";
|
|
10
10
|
|
|
11
11
|
import { assert } from "node-opcua-assert";
|
|
@@ -82,8 +82,9 @@ function extractChannelData(channel: ServerSecureChannelLayer): IChannelData {
|
|
|
82
82
|
|
|
83
83
|
function dumpChannelInfo(channels: ServerSecureChannelLayer[]): void {
|
|
84
84
|
function d(s: IServerSessionBase) {
|
|
85
|
-
return `[ status=${s.status} lastSeen=${s.clientLastContactTime.toFixed(0)}ms sessionName=${s.sessionName} timeout=${
|
|
86
|
-
|
|
85
|
+
return `[ status=${s.status} lastSeen=${s.clientLastContactTime.toFixed(0)}ms sessionName=${s.sessionName} timeout=${
|
|
86
|
+
s.sessionTimeout
|
|
87
|
+
} ]`;
|
|
87
88
|
}
|
|
88
89
|
function dumpChannel(channel: ServerSecureChannelLayer): void {
|
|
89
90
|
console.log("------------------------------------------------------");
|
|
@@ -379,7 +380,6 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
|
|
|
379
380
|
}
|
|
380
381
|
//
|
|
381
382
|
|
|
382
|
-
|
|
383
383
|
// resource Path is a string added at the end of the url such as "/UA/Server"
|
|
384
384
|
const resourcePath = (options.resourcePath || "").replace(/\\/g, "/");
|
|
385
385
|
|
|
@@ -399,23 +399,26 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
|
|
|
399
399
|
|
|
400
400
|
// now build endpointUrl
|
|
401
401
|
this._endpoints.push(
|
|
402
|
-
_makeEndpointDescription(
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
402
|
+
_makeEndpointDescription(
|
|
403
|
+
{
|
|
404
|
+
collection: this._policy_deduplicator,
|
|
405
|
+
hostname,
|
|
406
|
+
server: this.serverInfo,
|
|
407
|
+
serverCertificateChain: this.getCertificateChain(),
|
|
408
|
+
|
|
409
|
+
securityMode,
|
|
410
|
+
securityPolicy,
|
|
411
|
+
|
|
412
|
+
allowUnsecurePassword: options.allowUnsecurePassword,
|
|
413
|
+
resourcePath: options.resourcePath,
|
|
414
|
+
|
|
415
|
+
restricted: !!options.restricted,
|
|
416
|
+
securityPolicies: options.securityPolicies || [],
|
|
417
|
+
|
|
418
|
+
userTokenTypes
|
|
419
|
+
},
|
|
420
|
+
this
|
|
421
|
+
)
|
|
419
422
|
);
|
|
420
423
|
}
|
|
421
424
|
|
|
@@ -508,7 +511,7 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
|
|
|
508
511
|
|
|
509
512
|
this._server!.listen(
|
|
510
513
|
this.port,
|
|
511
|
-
/*"::",*/(err?: Error) => {
|
|
514
|
+
/*"::",*/ (err?: Error) => {
|
|
512
515
|
// 'listening' listener
|
|
513
516
|
debugLog(chalk.green.bold("LISTENING TO PORT "), this.port, "err ", err);
|
|
514
517
|
assert(!err, " cannot listen to port ");
|
|
@@ -516,12 +519,10 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
|
|
|
516
519
|
if (!this.port) {
|
|
517
520
|
const add = this._server!.address()!;
|
|
518
521
|
this.port = typeof add !== "string" ? add.port : this.port;
|
|
519
|
-
|
|
520
522
|
}
|
|
521
523
|
this._end_listen();
|
|
522
524
|
}
|
|
523
525
|
);
|
|
524
|
-
|
|
525
526
|
}
|
|
526
527
|
|
|
527
528
|
public killClientSockets(callback: (err?: Error) => void): void {
|
|
@@ -692,7 +693,7 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
|
|
|
692
693
|
debugLog(
|
|
693
694
|
chalk.bgWhite.cyan(
|
|
694
695
|
"OPCUAServerEndPoint#_on_client_connection " +
|
|
695
|
-
|
|
696
|
+
"SERVER END POINT IS PROBABLY SHUTTING DOWN !!! - Connection is refused"
|
|
696
697
|
)
|
|
697
698
|
);
|
|
698
699
|
socket.end();
|
|
@@ -702,7 +703,7 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
|
|
|
702
703
|
console.log(
|
|
703
704
|
chalk.bgWhite.cyan(
|
|
704
705
|
"OPCUAServerEndPoint#_on_client_connection " +
|
|
705
|
-
|
|
706
|
+
"The maximum number of connection has been reached - Connection is refused"
|
|
706
707
|
)
|
|
707
708
|
);
|
|
708
709
|
const reason = "maxConnections reached (" + this.maxConnections + ")";
|
|
@@ -938,7 +939,6 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
|
|
|
938
939
|
}
|
|
939
940
|
|
|
940
941
|
interface MakeEndpointDescriptionOptions {
|
|
941
|
-
|
|
942
942
|
/**
|
|
943
943
|
* @default default hostname (default value will be full qualified domain name)
|
|
944
944
|
*/
|
|
@@ -1139,7 +1139,7 @@ function _makeEndpointDescription(options: MakeEndpointDescriptionOptions, paren
|
|
|
1139
1139
|
}
|
|
1140
1140
|
// return the endpoint object
|
|
1141
1141
|
const endpoint = new EndpointDescription({
|
|
1142
|
-
endpointUrl:
|
|
1142
|
+
endpointUrl: "<to be evaluated at run time>", // options.endpointUrl,
|
|
1143
1143
|
|
|
1144
1144
|
server: undefined, // options.server,
|
|
1145
1145
|
serverCertificate: options.serverCertificateChain,
|
|
@@ -1152,7 +1152,7 @@ function _makeEndpointDescription(options: MakeEndpointDescriptionOptions, paren
|
|
|
1152
1152
|
transportProfileUri: default_transportProfileUri
|
|
1153
1153
|
}) as EndpointDescriptionEx;
|
|
1154
1154
|
endpoint._parent = parent;
|
|
1155
|
-
|
|
1155
|
+
|
|
1156
1156
|
// endpointUrl is dynamic as port number may be adjusted
|
|
1157
1157
|
// when the tcp socker start listening
|
|
1158
1158
|
(endpoint as any).__defineGetter__("endpointUrl", () => {
|
package/source/server_engine.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { EventEmitter } from "events";
|
|
5
5
|
import { types } from "util";
|
|
6
6
|
import * as async from "async";
|
|
7
|
-
import
|
|
7
|
+
import chalk from "chalk";
|
|
8
8
|
import { assert } from "node-opcua-assert";
|
|
9
9
|
import { BinaryStream } from "node-opcua-binary-stream";
|
|
10
10
|
import {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// tslint:disable:no-console
|
|
5
5
|
|
|
6
6
|
import { EventEmitter } from "events";
|
|
7
|
-
import
|
|
7
|
+
import chalk from "chalk";
|
|
8
8
|
|
|
9
9
|
import { SessionContext, AddressSpace, BaseNode, Duration, UAObjectType } from "node-opcua-address-space";
|
|
10
10
|
import { assert } from "node-opcua-assert";
|