C
C
coderage2019-07-24 17:33:26
Node.js
coderage, 2019-07-24 17:33:26

How to implement the use of proxy for https requests without using the request module?

The request module has the ability to proxy requests. How to implement the same using standard node.js modules?

const request = require('request');
request.get({
  url: 'https://toster.ru/q/461924',
  proxy: 'http://195.209.176.2:8080'
}, (err, res) => {
  if (err) {
    console.log('ERROR', err);
  } else {
    console.log('OK', res);
  }
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question