Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.js to allow adding got opts #25

Merged
merged 6 commits into from
Jul 30, 2019
Merged

Conversation

noname001
Copy link

No description provided.

@codecov-io
Copy link

codecov-io commented Jun 11, 2019

Codecov Report

Merging #25 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #25     +/-   ##
=========================================
+ Coverage   92.64%   92.75%   +0.1%     
=========================================
  Files           2        2             
  Lines          68       69      +1     
=========================================
+ Hits           63       64      +1     
  Misses          5        5
Impacted Files Coverage Δ
index.js 90.74% <100%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bb904a...74b102c. Read the comment docs.

@noname001 noname001 changed the title add got opts Update index.js to allow adding got opts Jun 11, 2019
@vitalets
Copy link
Owner

@noname001 Could you show the case when this is needed?

@noname001
Copy link
Author

noname001 commented Jun 18, 2019

@vitalets Google Translate has request limits to avoid them - need to use a proxy:

const translate = require('@vitalets/google-translate-api'),
tunnel = require('tunnel');
translate('Ik spreek Engels', {to: 'en'}, {agent: tunnel.httpsOverHttp({
    proxy: { 
      host: 'whateverhost',
      proxyAuth: "user:pass",
      port: '8080',
      headers: {
        'User-Agent': 'Node'
      }
    }
  })})

@vitalets
Copy link
Owner

Yes, that's useful!
Could you add tests and update readme to let other people know about gotopts parameter.

@noname001
Copy link
Author

noname001 commented Jun 19, 2019

Readme - well done. What tests should check? Even if tests are necessary, I do not have enough time to write them. Sorry..

@vitalets
Copy link
Owner

What tests should check?

I think single test for a particular got option is enough. For example, we can check that hooks.afterResponse is called.

@ZyC0R3
Copy link

ZyC0R3 commented Jul 14, 2019

this seems like it would resolve the issuie with roor 429 and 503 ( #9 #3 ) error and #30

Any update on if this will be merged and if the porxy will be added in.

@vitalets vitalets merged commit 74b102c into vitalets:master Jul 30, 2019
@vitalets
Copy link
Owner

this seems like it would resolve the issuie with roor 429 and 503 ( #9 #3 ) error and #30

Any update on if this will be merged and if the porxy will be added in.

Released as 2.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants