boostercloud / booster

Booster Framework
https://www.boosterframework.com
Apache License 2.0
409 stars 83 forks source link

Error: Address Already in Use When Running Multiple Booster Services on Different Ports because websockets port is not configurable #1495

Open javiertoledo opened 8 months ago

javiertoledo commented 8 months ago

Bug Report

Current Behavior

When attempting to run two Booster services locally on different ports (3000 and 3001), the first service starts successfully, but starting the second service on port 3001 results in an error. The error message indicates listen EADDRINUSE: address already in use :::65529, suggesting a conflict with the WebSocket port, which seems to default to 65529 and does not change when specifying a different HTTP port.

Expected Behavior

Each Booster service should start successfully on its designated port without conflicting on the WebSocket port. The expectation is that running multiple Booster services locally should be feasible, with each service operating independently on its respective port.

Possible Solution

A potential solution could involve providing a way to configure the WebSocket port via the CLI, similar to how the HTTP port is set. This would allow different instances of Booster services to use distinct WebSocket ports and avoid conflicts.

javiertoledo commented 8 months ago

Workaround

You can override the default WS port by setting the LOCAL_ENVIRONMENT_WEBSOCKET_SERVER_PORT environment variable to a different number.

You can run your web sockets server in a different port by running the local environment this way:

$ LOCAL_ENVIRONMENT_WEBSOCKET_SERVER_PORT=31415 npx boost start -e local -p 3001