Skip to content

chore: Listen on IPv6 by default #650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion api/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ processes = []

[env]
PORT = "8080"
HOST = "0.0.0.0"
# Listen on IPv6 by default
# https://fly.io/docs/networking/private-networking/#listening-for-connections-on-6pn-addresses
HOST = "::"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we listen on fly-local-6pn?

Your app’s service needs to bind to/listen on fly-local-6pn to be accessible via its 6PN address. For example, if you have a service running on port 8080, then you need to bind it to fly-local-6pn:8080 for it to be accessible to other Machines over the 6PN.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my understanding, this will break public access to this service via https://api.filspark.com.

See https://fly.io/docs/networking/app-services/#tl-dr

Screenshot 2025-06-24 at 08 44 21

https://fly.io/docs/networking/app-services/#a-note-on-ipv4-and-ipv6-wildcards

Services to be routed to using Fly Proxy need to bind to IPv4 addresses, and services to be reached over 6PN need to bind to IPv6, as described above. However, you may find that your service works even if you haven’t used the addresses we specified. IPv4-mapped IPv6 addresses, if enabled on the VM, can allow IPv4 (and thus Fly Proxy) connections to a service bound on [::]. Further, the wildcard syntax [::] or 0.0.0.0 sometimes covers both IPv4 and IPv6, depending on the language, library, or application.

Have you considered using Flycast private proxy instead of private networking? That would allow us to keep listening on IPv4.

https://fly.io/docs/networking/flycast/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, can we listen on both 0.0.0.0 and ::?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've taken a better look at the flycast and I think that would probably be a better solution. With flycast migration could be easier as we could setup the whole infrastructure to communicate over the private flycast address and once we're ready to migrate we can release our public IPs. 👍🏻

SENTRY_ENVIRONMENT = "production"
DOMAIN = "api.filspark.com"
REQUEST_LOGGING = "false"
Expand Down