node-vkontakte icon indicating copy to clipboard operation
node-vkontakte copied to clipboard

Request proxy support

Open Asp3ctus opened this issue 12 years ago • 3 comments

Added a request proxy support

I think it is needed feature for this king of module :)

Asp3ctus avatar Oct 29 '12 16:10 Asp3ctus

There must be a better way to pass goodiness to request without turning API into a swiss army knife with a kitchen sink. And I'm kinda working on it.

Thanks for calling it a 'king of module', anyways. :)

stevebest avatar Oct 30 '12 10:10 stevebest

LOL ... miss spelled king - kind :) If you add this feature in different way it be better ...

Asp3ctus avatar Oct 30 '12 13:10 Asp3ctus

You should probably add an ability for dependency injection for request using request.defaults({}) then:

var vk = vkontakte('CLIENT ID', 'CLIENT SECRET');
vk.setRequest(request.defaults({proxy: ...}));
vk('users.get', { uid: 1, fields: 'uid,first_name,photo' }, function (err, user) {
  console.log(user);
});

Unfortunately since you don't use oop, it's harder to implement.

AlexeyKupershtokh avatar Dec 14 '12 06:12 AlexeyKupershtokh