@codebolt/codeboltjs 1.1.82 → 1.1.83
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/modules/websocket.js +3 -2
- package/package.json +1 -1
- package/src/modules/websocket.ts +4 -2
package/modules/websocket.js
CHANGED
|
@@ -16,8 +16,9 @@ class cbws {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
const uniqueConnectionId = this.getUniqueConnectionId();
|
|
18
18
|
const initialMessage = this.getInitialMessage();
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const agentIdParam = process.env.AGENT_ID ? `&agentId=${process.env.AGENT_ID}` : '';
|
|
20
|
+
const parentIdParam = process.env.PARENT_ID ? `&parentId=${process.env.PARENT_ID}` : '';
|
|
21
|
+
this.websocket = new ws_1.default(`ws://localhost:${process.env.SOCKET_PORT}/codebolt?id=${uniqueConnectionId}${agentIdParam}${parentIdParam}${process.env.Is_Dev ? '&dev=true' : ''}`);
|
|
21
22
|
this.initializeWebSocket(initialMessage).catch(error => {
|
|
22
23
|
console.error("WebSocket connection failed:", error);
|
|
23
24
|
});
|
package/package.json
CHANGED
package/src/modules/websocket.ts
CHANGED
|
@@ -14,8 +14,10 @@ class cbws {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
const uniqueConnectionId = this.getUniqueConnectionId();
|
|
16
16
|
const initialMessage = this.getInitialMessage();
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
|
|
18
|
+
const agentIdParam = process.env.AGENT_ID ? `&agentId=${process.env.AGENT_ID}` : '';
|
|
19
|
+
const parentIdParam = process.env.PARENT_ID ? `&parentId=${process.env.PARENT_ID}` : '';
|
|
20
|
+
this.websocket = new WebSocket(`ws://localhost:${process.env.SOCKET_PORT}/codebolt?id=${uniqueConnectionId}${agentIdParam}${parentIdParam}${process.env.Is_Dev ? '&dev=true' : ''}`);
|
|
19
21
|
this.initializeWebSocket(initialMessage).catch(error => {
|
|
20
22
|
console.error("WebSocket connection failed:", error);
|
|
21
23
|
});
|