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:
@@ -5,6 +5,7 @@ connectors:
|
||||
carefulSubscription: true
|
||||
url: ws://ris-live.ripe.net/v1/ws/
|
||||
perMessageDeflate: true
|
||||
authorizationHeader: null
|
||||
subscription:
|
||||
moreSpecific: true
|
||||
type: UPDATE
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user