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

Set proxy use needle.defaults ? #194

Closed
starzou opened this issue Nov 25, 2016 · 1 comment
Closed

Set proxy use needle.defaults ? #194

starzou opened this issue Nov 25, 2016 · 1 comment

Comments

@starzou
Copy link

starzou commented Nov 25, 2016

Every time to set up looks very cumbersome.

needle.get(url, {proxy: 'http://url:port'}, function (error, response) {
  if (!error && response.statusCode == 200) {
    console.log(response.body);
  }

  console.log(error);
});

Use

needle.defaults({
   proxy: 'http://url:port'
});
@tomas
Copy link
Owner

tomas commented Nov 25, 2016

Done! Pushing a new release in 3..2..1..

@tomas tomas closed this as completed Nov 25, 2016
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

No branches or pull requests

2 participants