1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

introduced authentication header for websocket connection

This commit is contained in:
Massimo Candela
2021-10-25 13:29:05 +02:00
parent 006eb64e6b
commit 5dd90db7ba
2 changed files with 8 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ connectors:
carefulSubscription: true
url: ws://ris-live.ripe.net/v1/ws/
perMessageDeflate: true
authorizationHeader: null
subscription:
moreSpecific: true
type: UPDATE

View File

@@ -48,7 +48,6 @@ export default class ConnectorRIS extends Connector {
this.canaryBeacons = {};
this.url = brembo.build(this.params.url, {
path: [],
params: {
client: env.clientId
}
@@ -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;
}