You may need to configure a proxy server if you're having trouble cloning
or fetching from a remote repository or getting an error
like unable to access '...' Couldn't resolve host '...'
.
Consider something like:
var Util = require('util'); | |
var Https = require('https'); | |
var Tls = require('tls'); | |
/** | |
* HTTPS Agent for node.js HTTPS requests via a proxy. | |
* blog.vanamco.com/connecting-via-proxy-node-js/ | |
*/ | |
function HttpsProxyAgent(options) | |
{ |
require('dotenv').config(); | |
const request = require('request'); | |
const credentials = `${process.env.CONSUMER_KEY}:${process.env.CONSUMER_SECRET}`; | |
const credentialsBase64Encoded = new Buffer(credentials).toString('base64'); | |
request({ | |
url: 'https://api.twitter.com/oauth2/token', | |
method:'POST', | |
headers: { |