telegraf-wit
telegraf-wit copied to clipboard
Allow use behind proxy
To allow setting a proxy I've added the use of the agent option in the following two sections of code
https://github.com/telegraf/telegraf-wit/blob/94534277cdbb0ff787d11fc6d0999eb1b564db58/lib/wit.js#L23-L29
https://github.com/telegraf/telegraf-wit/blob/94534277cdbb0ff787d11fc6d0999eb1b564db58/lib/wit.js#L40-L47
They now look like
return fetch(url, {
method: 'GET',
agent: this.opts.agent,
headers: {
'Authorization': `Bearer ${this.token}`,
'Accept': 'application/json',
'v': this.apiVersion
}