instagram-web-api icon indicating copy to clipboard operation
instagram-web-api copied to clipboard

Trying to setup my own node proxy

Open fmontes opened this issue 4 years ago • 1 comments

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.

fmontes avatar Oct 09 '20 12:10 fmontes

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

raginisahu avatar Jul 18 '21 02:07 raginisahu