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
|
carefulSubscription: true
|
||||||
url: ws://ris-live.ripe.net/v1/ws/
|
url: ws://ris-live.ripe.net/v1/ws/
|
||||||
perMessageDeflate: true
|
perMessageDeflate: true
|
||||||
|
authorizationHeader: null
|
||||||
subscription:
|
subscription:
|
||||||
moreSpecific: true
|
moreSpecific: true
|
||||||
type: UPDATE
|
type: UPDATE
|
||||||
|
@@ -48,7 +48,6 @@ export default class ConnectorRIS extends Connector {
|
|||||||
this.canaryBeacons = {};
|
this.canaryBeacons = {};
|
||||||
|
|
||||||
this.url = brembo.build(this.params.url, {
|
this.url = brembo.build(this.params.url, {
|
||||||
path: [],
|
|
||||||
params: {
|
params: {
|
||||||
client: env.clientId
|
client: env.clientId
|
||||||
}
|
}
|
||||||
@@ -99,6 +98,13 @@ export default class ConnectorRIS extends Connector {
|
|||||||
const wsOptions = {
|
const wsOptions = {
|
||||||
perMessageDeflate: this.params.perMessageDeflate
|
perMessageDeflate: this.params.perMessageDeflate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (this.params.authorizationHeader){
|
||||||
|
wsOptions.headers = {
|
||||||
|
Authorization: this.params.authorizationHeader
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.params.noProxy && this.agent) {
|
if (!this.params.noProxy && this.agent) {
|
||||||
wsOptions.agent = this.agent;
|
wsOptions.agent = this.agent;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user