I’ve added a Heroku addon to get a static IP Address.
I’ve tried Fixie, Fixie Socks, now I’m using Quotaguard (each on results in same error).
I’m adding those static IPs to Atlas’s whitelisted IP addresses.
The Mongo connection URL is added as a Heroku env var.
new MongoNetworkError(
MongoNetworkError: failed to connect to server [cluster0-shard-00-01.0kdvb.mongodb.net:27017] on first connect [Error: write EPIPE
In localhost everything works (I’ve whitelisted my Macbooks IP address). But on Heroku it fails.
I know it is suggested to open the whitelist to ALL IP addresses. But that just is a terrible solution. There has to be a way to make this work.
I also experienced the same issue. As the IP address is not whitelisted you can allow any IP.
For the production purpose that is not a good approach. You can do it by QuotaGuard Static. I didn’t try it. I just simply want to know how these stuffz works.
I just can’t get this working, which is really frustrating. When you search around for this, i’ve found very little. People keep saying “allow access from anywhere” - this is the polar opposite of what i want to do.