Telegram Bot API server with Railway Private Network

kreison
PRO

a year ago

I am running locally (--local) Telegram Bot API. I decided to make it a separate service. But in order to communicate between services I need to use Railway Private Network. Doing this I get an error Unhandled rejection RequestError: Error: connect ECONNREFUSED fd12:e09c:1da7::93:a551:ab7c:8081. My internal link is http://telegram-server.railway.internal:8081. I also ran a small test express server, on port 8082 and it works fine

1 Replies

a year ago

you are getting the ECONNREFUSED error because the service you are trying to call is not listening on ipv6 (the private network is ipv6 only)

your express server works fine since it does listen on both ipv4 and ipv6 by default.

please see this docs page for more information https://docs.railway.app/guides/private-networking


Telegram Bot API server with Railway Private Network - Railway Help Station