Skip to content

Ports & Proxy

Billy.Zheng edited this page Apr 13, 2026 · 6 revisions

Procodile can handle allocation of ports to your process. When you use this, Procodile will simply set a PORT environment variable for a process when it is started. You can use the --ports option when starting processes to assign specific ports. By default, no ports will be allocated (unless the proxy is being used - see below).

Port allocation supports both tcp and udp through the network_protocol process option. This only affects how Procodile checks whether a port is available before assigning it.

To assign explicit ports, pass PROCESS:PORT pairs to --ports when running procodile start. For example: --ports=web:3001,websocket:3002. Each entry must include an explicit port.

Proxy

Procodile has a built-in development-only proxy which allows you to route traffic to the instances of your processes (much like you'll probably do in production). This proxy should only be used in development and is not designed to handle production traffic - you should use something like nginx or HAProxy.

When you enable the proxy for a process, Procodile will listen on the TCP port you specified and pass data from this port to the ports which your process will open.

Procodile's built-in proxy is TCP-only. It does not proxy UDP traffic.

Procodile will provide your process with a port to listen on in the PORT environment variable.

Why do this?

Many applications are usually all configured to listen on the same port which can be irritating in development if you have to stop one to work on another. Using the proxy, you can choose the ports you want to use (in a Procfile.local file) and let the system choose which ports to actually assign to the running processes.

How do I set it up?

To enable the proxy you need to start the supervisor with the --proxy (or -x for short) option and set proxy_port in Configuration. When you've done this, stop everything and start it again - you should see that it's listening on your new port. After proxy mode is already enabled, later changes to process-level proxy settings can be applied with procodile reload.

$ procodile stop --stop-supervisor
$ procodile start --proxy

You'll be able to use the procodile status command to see further information.

Clone this wiki locally