Python asyncio raw TCP server on Fly.io drops external client connections while internal health checks pass
17:15 02 Sep 2026

I am trying to establish a stable, raw TCP connection between a local Python-based coordinator and a Python receiver application hosted on Fly.io (App name: receiver-sin, region sin) listening on port 9999

While internal Fly.io TCP health checks (originating from IP 172.19.42.121) successfully ping port 9999, external public TCP traffic from my local machine is being dropped or swallowed at Fly.io's public edge router before it ever reaches the application container. The client connection times out or fails to receive the initial server handshake.

Current Configuration (fly.toml)

I have configured the service for raw TCP passthrough with proxy protocol disabled and an active TCP health check:

Ini, TOML

[[services]]
  protocol = "tcp"
  internal_port = 9999
  concurrency_limit = 0

  [services.ports]
    port = 9999
    handlers = []          # Pure raw TCP
    proxy_protocol = false # Disabled proxy headers

  [[services.tcp_checks]]
    interval = "15s"
    timeout = "2s"

What I've Checked:

  • The server uses Python's asyncio stream handler.

  • The buffer limit has been increased to handle large incoming payloads.

  • The app logs show that health check connections connect and disconnect normally, but external client sockets from public IPs never trigger application-level connection handlers.

Question

Why is Fly.io's public edge proxy dropping external public TCP connections on a custom port even when handlers = [] and proxy_protocol = false are set? Is there a specific edge-routing behavior or proxy setting required to allow external raw TCP clients to pass through?

python network-programming tcp python-asyncio