RailwayDocs

Library Configuration

Some libraries and components require explicit configuration for dual-stack (IPv4/IPv6) networking or to work properly in legacy IPv6-only environments.

Node.js libraries

ioredis

ioredis is a Redis client for node.js, commonly used for connecting to Redis from a node application.

When initializing a Redis client using ioredis, you must specify family=0 in the connection string to support connecting to both IPv6 and IPv4 endpoints:

ioredis docs

bullmq

bullmq is a message queue and batch processing library for node.js, commonly used for processing jobs in a queue.

When initializing a bullmq client, you must specify family: 0 in the connection object to support connecting to both IPv6 and IPv4 Redis endpoints:

bullmq docs

Hot-shots

hot-shots is a StatsD client for node.js, which can be used to ship metrics to a DataDog agent for example. When initializing a StatsD client using hot-shots, you must specify that it should connect over IPv6:

hot-shots docs

Go libraries

Fiber

fiber is a web framework for Go. When configuring your Fiber app, you should set the Network field to tcp to have it listen on IPv6 as well as IPv4:

Fiber docs

Docker images

MongoDB

If you are creating a service using the official Mongo Docker image from Docker Hub and would like to connect to it over the private network, you must start the container with options to instruct the Mongo instance to listen on IPv6. Set this in your Start Command:

Note: The official MongoDB template provided by Railway is already deployed with this Start Command.

Adding more libraries

If you encounter a library that requires specific configuration for Railway's private networking, please let us know on the Railway Discord or submit a PR to the documentation.