I’m curious if there is a reliable way to detect if an incoming connection to a Fly machine is from another Fly machine or the public internet. I know that Fly does a lot of fancy things with 6pn addresses, so I am sorta hoping I can use address semantics to figure this out.
Thanks for the tip! Unfortunately my use case involves raw TCP connections using a custom protocol. For now I’m going to be detecting internal vs external via my protocol’s header, however it would be very convenient if there were docs on interpreting incoming addrs.
Actually… I just realized, if I connect machine → machine directly, the ip that the receiving machine sees should be the 6pn address of the sending machine right? If so, can’t I detect this via just checking that the first 4 bytes of the address is equal to the receiving machine’s address? Accoridng to the docs the first four bytes should be my organization address right? I assume that connections from the fly proxy will have a different organization address
Yes, if you’re doing machine to machine communication, the address would be the 6PN of the sender. We’ve documented the parts of the address, Private Networking · Fly Docs and hopefully provides what you’re looking for.