IP address for fly.io app not recognised in MongoDB Atlas - mongodb

I'm trying to limit connection to my MongoDB Atlas cluster from only my fly.io app. I have its IPv4 address from the app deployment page (screenshot below)
and added it to the whitelist in MongoDB Atlas (screenshot below)
The problem is that this doesn't even appear to be enough to allow a connection from my app to my cluster. Even increasing the IP range to 137.66.12.0/23 doesn't help. I've had to allow connection from anywhere in order to get my fly app to connect. I don't have this problem if I'm trying to whitelist my own laptop to develop locally.
I should clarify that performing a dig on my app's URL does bring up the IP address in the first screenshot, so at least this confirms that the IP address is not internal to fly.io.
Can anyone explain what's happening here? Is there a way I can work around this?
Thanks in advance!

I think at the time of writing this there's no way for you to do this see here
However they've given out some IP's based on a few regions that you can try your hand at
list of some outbound IP's based on location
Be warned though, these ip's can change on a whim though

Related

Setup a server that can detect IP addresses of clients

I am trying to set up what is possibly a webserver that can detect the IP addresses of the clients that try to access the webpage. In the simplest terms.
1)Let there be a table on the website.
2)Each time a client requests the website, its IP address gets added to the entry of the table.
I have made a webserver before using apache tomcat and even nodejs. But I have no idea how to detect IP adresses. I would also like to know if its possible to set this up online, in the cheapest possible way.
Perhaps nodejs would work using request.connection.remoteAddress, as in this example.

what does the 1233 behind the colon represents in www.happy.com:1233

I am planning to set up a Content Management System which is entirely owned by myself. I encountered someone who could help me do so, but I realised that the developer created something with the following site: www.happy.com:1234.
Does it mean that 1233 is a database and that the entire website/server is still owned by developer?
In the URL
www.happy.com:1233
The number 1233 is the port to which your browser is attempting to connect. Perhaps unbeknownst to you, in order to connect to a server, we need both an IP address and a port. Here, the IP address will be resolved using the website name www.happy.com.

Is there a way for a bot to find the IP address of my Digital Ocean Server when going through Cloudflare?

I am a PHP coder but not a server expert so I wondered if anyone could answer the following query.
Is there a way that a bot can determine the IP of my server when it runs through Cloudflare?
Someone suggested that folk could try ftp.domain.com and things like that. I do not have that setup on my server although Cloudflare do set this up automatically for you when you register a domain.
If you are a server expert and wanted to determine the actual IP of a server, how would you go about it?
Thanks.
PS: I do not want my IP public, hence the question.
Someone that really wants to find your server IP address probably can. We're only going to really stop basic lookups from returning your IPs, but we can only proxy web traffic & some records on your domain (mail, for example) may still return your server IP.
We do have some tips on minimizing the probability that someone could find it easily with these guidelines.

iphone app can't see internal network

I'm working on an Enterprise app that communicates with our company servers. I have full two-way communication between the phone and the server through 3G/4G, and it works from my home wifi, but using the wifi at the office where it is connected to the company network the app doesn't see the server that way.
The app is set to look for our external IP address, and the port is open to the server. But I guess the external IP address is not 'visible' from within the network. When I plug in the internal IP address of the server, it goes through just fine.
For the vast number of our users, that would not be a problem. Most of our users (employees) work in the field or in other offices. But for users inside our network, this arrangement is useless unless the user turned off his wifi. But that's not a professional way to do it.
I need to know if there's a way for my app to either use 3G/4G exclusively, or to discover the SSID of the wifi and decide which IP address to use. I'm guessing that the answers to both of these will be, "you can't do that," But I thought I'd ask anyway.
Thanks!
You could have it attempt the internal IP, and fall back to the external IP if it can't connect. A better solution might be to have an internal DNS server that serves the internal IP to in-network devices, though.
Well, I discovered this code is exactly what I need. It gives me the SSID in string form, and I can compare the SSID string with a string of our wifi's SSID, and if it matches then the app uses the internal IP address. And if it doesn't match, it will connect to the external IP address. So far it works perfectly!
Followup: ceejayoz, I don't know if your second suggestion is the same as what our IT guy did, but he created a domain name that will resolve to the server whether it's internal or external. That seems to be the best way to go. So even though I had a workable answer, the URL works better with less code.

Peer-to-peer chat with the iPhone

I am aware of how many times this has been asked based on searching StackOverflow, but I am still hoping someone could tell me whether I am wrong...
I am creating a peer-to-peer chat app for the iPhone. My initial idea was to avoid using a server, so Bonjour came to mind. I was happy coding for quite a while and implemented a lot of fancy features, but two days ago I started testing with two clients from different subnets and found that the clients couldn't connect to each other! I suddenly realized that Bonjour is meant for local networks and that a DNS server is necessary for wide area service broadcasting. Do I really need a server for Internet peer-to-peer chat? Are there any other options that do not involve using a server on the iOS platform?
I am wondering how you can do a chat app without using a server. There are many cheap solutions out there, Amazon has its own service, Google does as well. You can try first without even having to pay a cent.
I found the following from apple developer guide. This should answer your question -
Does Bonjour work between multiple subnets?
Yes. The first release of DNS Service Discovery (DNS-SD) for Mac OS X concentrated on Multicast DNS (mDNS) for single-link networks because this was the environment worst served by IP software. Starting in Mac OS X 10.4, Bonjour now uses Dynamic DNS Update (RFC 2316) and unicast DNS queries to enable wide-area service discovery.
To answer the question, the only way is for you to carry a list of all possible participants, and their current IP address, and for each possible participant to report to all others each time their IP Address changes. So, if you have 100 possible participants, then you must tell 99 others when your IP Address changes, and those 99 must tell you when their IP Address changes.
Bonjour may work on a LAN, a WAN or even a WAN, but it will never work on the internet.
The role of the server is so that each end point only need to tell one end point (the server) when it changes. My advice is get a cheap internet host, with a basic PHP / MySQL capabilities, and write yourself a very simple script to post and get user identities.