import http from 'http';
import httpProxy from 'http-proxy';
//
// Create your custom server and just call `proxy.web()` to proxy
// a web request to the target passed in the options
// also you can use `proxy.ws()` to proxy a websockets request
//
var proxy = httpProxy.createProxyServer({ changeOrigin: true });
var server = http.createServer(function (req, res) {
// You can define here your custom logic to handle the request
// and then proxy the request.
proxy.web(req, res, {
changeOrigin: true
});
});
console.log('listening on port 9000');
server.listen(9000);
But when I add it to instagram-web-api and try to fetch content I get this error:
RequestError: Error: tunneling socket could not be established, cause=Hostname/IP does not match certificate's altnames: Host: www.instagram.com. is not in the cert's altnames: DNS:*.xxxx.com, DNS:xxxxx.io
Hello,
I tried to create my own custom proxy in node:
But when I add it to
instagram-web-api
and try to fetch content I get this error:Any ideas?
Thanks in advaced.