jlobos / instagram-web-api

🤳 Instagram Private Web API client for Node
https://npmjs.com/instagram-web-api
MIT License
1.12k stars 186 forks source link

Trying to setup my own node proxy #192

Open fmontes opened 4 years ago

fmontes commented 4 years ago

Hello,

I tried to create my own custom proxy in node:

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

Any ideas?

Thanks in advaced.

raginisahu commented 3 years ago

Yes, it means your proxy not working properly. check your proxy and check it is supporting by instragram or not.