private network gunicorn
andremaytorena
PROOP

9 months ago

I am trying to connect to my flask api via private network, I've set this start command as per docs:
gunicorn app:app --bind [::]:${PORT-3000}

The API initializes fine, but when I try to send a request from my other api through the private network like this:

try:
        res = requests.post("http://master-api.railway.internal:3000/call")
        print(res.text)
        print(res.status_code)
        return {}, 200
    except Exception as e:
        print(e)
        False```

It gives me this error:

HTTPConnectionPool(host='master-api.railway.internal', port=3000): Max retries exceeded with url: /call (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] ECONNREFUSED'))```

Solved

7 Replies

andremaytorena
PROOP

9 months ago

8eca95b8-b3e6-413d-8ee9-deeebf5ebef1


brody
EMPLOYEE

9 months ago

you want to use 8080 is the request since that is what gunicorn is listening on


andremaytorena
PROOP

9 months ago

Trying that now


andremaytorena
PROOP

9 months ago

ok that worked thank you


brody
EMPLOYEE

9 months ago

no problem!


brody
EMPLOYEE

9 months ago

!s


kvnbbg
HOBBY

7 months ago

so, we can't change the port for multiple app in only one group ?


Status changed to Solved brody 7 months ago


Loading...