TCP connection to "fly console -p 8080"

Hi there!

I noticed that fly console has -p option to publish port.
However I can’t figure out on which host that one-off app is going to be exposed.

fly console -p 8080:8080/tcp -C "nc -l 8080"

I have a Wireguard tunnel started, and I hoped I could connect to this nc server above just like I can connect to all other fly machines - something like

nc localhost 8080


nc some-name.internal

But I can’t figure out the DNS name of the fly console one-off app

Cheers, Vova

Hi… Machines are free to talk to each other over the private network by default, so you don’t actually need a flag:

$ fly console -C 'nc -l 8080'
Created an ephemeral machine 123456aa987654 to run the console.
Connecting to fdaa:1:abcd:a1a:255:dd02:1bb8:2... complete.

Then, from a shell that is able to reach .internal, in general…

> nc fdaa:1:abcd:a1a:255:dd02:1bb8:2 8080

(As far as I know, there isn’t a nice DNS entry.)

Hope this helps a little!

Aside: Out of curiousity, :black_cat:, I tried -p with an -a for an app that had a Flycast address, and the resulting ephemeral machine did respond at appname.flycast:8080.

This leads me to guess that this feature was made for Flycast / the public Internet. The port 8080 in your own experiment may have gotten exposed on—depending on which folder you ran fly console in.

(The docs mention handlers, which are characteristic of Fly’s proxy, and the source code related to -p has multiple occurrences of “edge”.)

1 Like

Added wishlist

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.