Skip to content

Commit

Permalink
introduced authentication header for websocket connection
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Oct 25, 2021
1 parent 006eb64 commit 5dd90db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ connectors:
carefulSubscription: true
url: ws://ris-live.ripe.net/v1/ws/
perMessageDeflate: true
authorizationHeader: null
subscription:
moreSpecific: true
type: UPDATE
Expand Down
8 changes: 7 additions & 1 deletion src/connectors/connectorRIS.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export default class ConnectorRIS extends Connector {
this.canaryBeacons = {};

this.url = brembo.build(this.params.url, {
path: [],
params: {
client: env.clientId
}
Expand Down Expand Up @@ -99,6 +98,13 @@ export default class ConnectorRIS extends Connector {
const wsOptions = {
perMessageDeflate: this.params.perMessageDeflate
};

if (this.params.authorizationHeader){
wsOptions.headers = {
Authorization: this.params.authorizationHeader
}
}

if (!this.params.noProxy && this.agent) {
wsOptions.agent = this.agent;
}
Expand Down

0 comments on commit 5dd90db

Please sign in to comment.