Trouble Connecting to Non-HTTP Service on Fly.io

Here’s an improved version of your text:


I am trying to run a non-HTTP service on Fly.io. The service listens on the internal port 8080, which is mapped to the external port 587. Here’s the current setup:

Services Configuration

> fly services list
Services
PROTOCOL        PORTS           HANDLERS        FORCE HTTPS     PROCESS GROUP   REGIONS MACHINES
                587 => 8080     []              False           app             sea     2

IP Addresses

> fly ips list
VERSION IP                      TYPE                    REGION  CREATED AT
v6      2a09:8280:1::59:4df7:0  public (dedicated)      global  12h0m ago
v4      66.241.125.75           public (shared)                 Jan 1 0001 00:00

Issue

I can successfully connect to the server when running the client locally on the Fly.io machine using fly ssh console. However, I encounter the error Connection unexpectedly closed when trying to connect to the Fly.io server externally.

Fly Configuration

[[services]]
internal_port = 8080

[[services.ports]]
port = 587

[env]
PORT = "8080"

Question

What am I missing in my configuration or setup? Thanks!

Works fine after I added a dedicated IP!

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