telegraf-wit icon indicating copy to clipboard operation
telegraf-wit copied to clipboard

Allow use behind proxy

Open rlogiacco opened this issue 7 years ago • 0 comments

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
      }

rlogiacco avatar May 25 '18 10:05 rlogiacco