Skip to content

Commit fdfffdf

Browse files
changes
1 parent f3dbe5e commit fdfffdf

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codebolt/codeboltjs",
3-
"version": "1.1.49",
3+
"version": "1.1.50",
44
"description": "",
55
"keywords": [],
66
"author": "",

src/modules/websocket.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class cbws {
2323
private getUniqueConnectionId(): string {
2424
try {
2525
let fileContents = fs.readFileSync('./codeboltagent.yml', 'utf8');
26-
let data:any = yaml.load(fileContents);
26+
let data: any = yaml.load(fileContents);
2727
return data.unique_connectionid;
2828
} catch (e) {
2929
console.error('Unable to locate codeboltagent.yml file.');
@@ -34,7 +34,7 @@ class cbws {
3434
private getInitialMessage(): string {
3535
try {
3636
let fileContents = fs.readFileSync('./codeboltagent.yml', 'utf8');
37-
let data:any = yaml.load(fileContents);
37+
let data: any = yaml.load(fileContents);
3838
return data.initial_message;
3939
} catch (e) {
4040
console.error('Unable to locate codeboltagent.yml file.');
@@ -57,7 +57,10 @@ class cbws {
5757
this.websocket.on('open', () => {
5858
console.log('WebSocket connected');
5959
if (this.websocket) {
60-
this.websocket.send(initialMessage);
60+
this.websocket.send(JSON.stringify({
61+
"type": "sendMessage",
62+
"message": initialMessage
63+
}));
6164
resolve(this.websocket);
6265
}
6366
});

0 commit comments

Comments
 (0)