Trying to get inbound UDP working with this guide: Running Fly Apps On UDP and TCP · Fly Docs
Fly services
[[services]]
internal_port = 443
protocol = "tcp"
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]
[[services.ports]]
port = "443"
[[services]]
internal_port = 80
protocol = "tcp"
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
port = "80"
[[services]]
internal_port = 3478
protocol = "udp"
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
port = "3478"
Golang code:
uaddr, err := net.ResolveUDPAddr("udp", listenAddr)
if err != nil {
return err
}
s.pc, err = net.ListenUDP("udp", uaddr)
if err != nil {
return err
}
log.Printf("server listening on %v, localaddr: %v", listenAddr, s.pc.LocalAddr())
prints: server listening on fly-global-services:3478, localaddr: 172.19.12.187:3478
Listen loop:
var buf [64 << 10]byte
var (
n int
ua *net.UDPAddr
err error
)
for {
fmt.Printf("waiting for udp package\n")
n, ua, err = s.pc.ReadFromUDP(buf[:])
(...)
Installed tcpdump and tried listening to eth0:
echo hello world | nc -w1 -u myapp.foo.bar 3478
oot@56833023b066e8:/app# tcpdump -i eth0 udp
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
Region is NRT. Am I missing something here? I’m correctly binding to fly-global-services, which resolves to the IP that’s in /etc/hosts