Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Allow use behind proxy #3

Open
rlogiacco opened this issue May 25, 2018 · 0 comments
Open

Allow use behind proxy #3

rlogiacco opened this issue May 25, 2018 · 0 comments

Comments

@rlogiacco
Copy link

To allow setting a proxy I've added the use of the agent option in the following two sections of code

telegraf-wit/lib/wit.js

Lines 23 to 29 in 9453427

return fetch(url, {
method: 'GET',
headers: {
'Authorization': `Bearer ${this.token}`,
'Accept': 'application/json',
'v': this.apiVersion
}

telegraf-wit/lib/wit.js

Lines 40 to 47 in 9453427

return fetch(url, {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.token}`,
'Accept': 'application/json',
'Content-Type': 'application/json',
'v': this.apiVersion
},

They now look like

return fetch(url, {
      method: 'GET',
      agent: this.opts.agent,
      headers: {
        'Authorization': `Bearer ${this.token}`,
        'Accept': 'application/json',
        'v': this.apiVersion
      }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant