Struggling to establish a connection through private networking
project id 8b67ba4d-ba67-4f38-97ef-8caab4e245fe
I have two services both running express JS. I have added a '::' to the call in order to bind to IPv6 ports.
The service trying to establish the connection is enabled for public and private. The other service is private only, and consistently refuses the connection.
14 Replies
Project ID:
8b67ba4d-ba67-4f38-97ef-8caab4e245fe
you'd need to use http and specific a port in the url when calling the private network
Your URL for internal calls should include the port
😇
Got it
is the PORT env var accessible through template functions?
For every service in the project?
Is this how I'm meant to share which port to point at to all my services?
if you sent one yourself, yes, the auto generated one, no
and you would want to set one yourself so there's no random ports in use
So what's the recommended way of giving each service on the internal network knowledge of eachother's ports?
Manually setting them eh?
set the port on the service then you can reference it in another service
Yeah jsut read that the auto-generated one is for public networking (Y)
"If you wish to open a service that has a public, you can use the PORT environment variable to specify the public port. This will allow Railway to route traffic to the public port."
I wouldn't say it's strictly for public networking as your app would still need to listen on PORT for healthchecks, and those are done internally
hmm
I'm about to set the PORT for these two services for private network
I've never chosen ports before, is there any recommended one?
What's the limit to the port numbers?
the same limit as the highest tcp port number, but I'd recommend common non privileged ports like 3000, 4000, 8000, 8080
Here's what chatGPT says
far too many words
everything I do is port 3000, and during my time on this server it's the most widely used