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

Override default options of request module #43

Open
dvneverov opened this issue May 29, 2018 · 0 comments
Open

Override default options of request module #43

dvneverov opened this issue May 29, 2018 · 0 comments

Comments

@dvneverov
Copy link

I want to proxy my requests via socks5 protocol.
Is it possible to set default options for request module?
So as I see it, it should look something like this:

const request = require('request');
const Agent = require('socks5-https-client/lib/Agent');
const request_with_defaults = request.defaults({
    strictSSL: true,
    agentClass: Agent,
    agentOptions: {
        socksHost: 'host'
        socksUsername: 'user',
        socksPassword: 'password',
        socksPort: 1080
    }, 
    'timeout': 5000, 'connection': 'keep-alive'
});

const soapOptions = {
    request: request_with_defaults,
};

let soapClient = EasySoap(params, soapOptions);
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

1 participant