when I'm deploying it gives me the warning app is not listening on the expected address and will not be reachable by fly proxy

WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
  - 0.0.0.0:8080
Found these processes inside the machine with open listening sockets:
  PROCESS        | ADDRESSES                            
-----------------*--------------------------------------
  /.fly/hallpass | [fdaa:2:5631:a7b:df:c9ac:8e61:2]:22  

  [2/2] Machine 080ee73f569ee8 [app] update finished: success
  Finished deploying

this is the error

app = "phone-craze"
primary_region = "mad"

kill_signal = "SIGTERM"
kill_timeout = 120

[env]
  PORT = 8080




[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0
  [http_service.concurrency]
    type = "requests"
    soft_limit = 200
    hard_limit = 250

this is my fly.toml file

I’m listening on port 8080 using my environment variable but still not working my status is as follows

  Name     = phone-craze                                        
  Owner    = personal                                           
  Hostname = phone-craze.fly.dev                                
  Image    = phone-craze:deployment-01H2JRM2FFZPBR0195DHD89WGN  
  Platform = machines                                           

Machines
PROCESS ID              VERSION REGION  STATE           CHECKS  LAST UPDATED         
app     080ee73f569ee8  9       mad     starting                2023-06-10T13:42:19Z
app     28744edc6595e8  9       mad     stopped                 2023-06-10T13:42:16Z

Hi,

Given the error message it seems it isn’t your port that’s the issue. It’s the address. You need to listen on 0.0.0.0 or :: (the IPv6 equivalent). Some apps may default to e.g use 127.0.0.1 or localhost.

How exactly you do that depends on your language/framework.

For example for Node you would have a line that’s something like this:

const PORT = process.env.PORT || 3001;

app.listen(PORT, "::", () => {
  console.log(`app listening on port ${PORT}`);
});

I made the changes you said but still the warning persists but now I can see the app when I go to hosted link

Machines
PROCESS ID              VERSION REGION  STATE   CHECKS  LAST UPDATED         
app     3d8d311ae95768  1       lhr     started         2023-06-10T22:52:17Z
app     9080013a610168  1       lhr     started         2023-06-10T22:52:12Z

The status looks like this now

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