Skip to content

Commit

Permalink
add origin on dgg ws client connect
Browse files Browse the repository at this point in the history
  • Loading branch information
ILiedAboutCake committed Apr 1, 2023
1 parent d9ed0ae commit a4a5f13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/configuration/sample.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"timezoneString": "svensk",
"dggChat": {
"url": "ws://localhost:8420",
"origin": "www.obamna.gg",
"cookieToken": "yourCookieToken",
"botNick": "yourBotNick"
},
Expand Down
2 changes: 2 additions & 0 deletions lib/services/destinychat.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class DestinyChat extends EventEmitter {
super();
this.logger = services.logger;
this.url = config.url;
this.origin = config.origin;
this.cookieToken = config.cookieToken;
this.botNick = config.botNick;
}

connect() {
this.ws = new WebSocket(this.url, {
origin: this.origin,
headers: { Cookie: `authtoken=${this.cookieToken}` },
});
this.ws.onopen = this.onOpen.bind(this);
Expand Down

1 comment on commit a4a5f13

@voloshink
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!

Please sign in to comment.