I have the fly.toml shown below. My app is exposing a UDP server at port 9000 and I would expect given the configuration below my service to be listening at myawesomeapp.fly.dev:443 but in fact it is being exposed at myawesomeapp.fly.dev:9000. Is this an incorrect understanding on my part or a bug on your end?
Any insight would be greatly appreciated!
(myawesomeapp is just a placeholder and is not the actual name of my project)
app = "myawesomeapp"
[env]
SD_PORT = 9000 # My app will bind to this port
[experimental]
cmd = "/myawesomeapp"
allowed_public_ports = []
auto_rollback = true
[[services]]
protocol = "udp"
internal_port = 9000 # My understanding is this is the port the app is listening on
[[services.ports]]
handlers = []
port = 443 # My understanding is that this is the port that is exposed to the internet
Do you know how I should proceed because my app is definitely listening on port 9000 and not 443 with the above configuration?
I have configured my app to bind to fly-global-services and my app prints the listening address on startup and it says Listening on 172.19.1.131:443. I am aware of the lack of IPv6 support and have hardcoded the client to talk to the IPv4 address (I am really looking forward to support for IPv6 though!).
I wonât know why that is the case. You could deploy the image to a new app to see if then works? Or, destroy the current one and create another in its place?
A toy echo udp server I had running on Fly did pretty much what you describe and it worked fine. The only difference I can tell is that my toy app had the same port number exposed as it was listening on (that is, both internal_port and port were listening on the same port number; but I canât see why different port numbers wonât work).
Wow, yeah, I cloned and deployed the code you shared. UDP only seems to work in âport forwardingâ mode (services.internal_port and services.ports.port must be the same thing). May be, that should be in the docs as it is a bit of a head-scratcher.
That PR is alright but given all of the documentation implies this is a valid setup, it is quite possibly a bug on Flyâs end, and unless someone from Fly can confirm that this is intentional the docs probably shouldnât be updated.
I might reach out to Fly directly if I donât see anything back here.