Websockets in different languages in the same web service?

this is my start command:
cargo run --release --manifest-path rust/Cargo.toml & python python/manage.py runserver 0.0.0.0:1000
I can connect to both websockets on localhost with the urls:
"ws://127.0.0.1:1000/python"
"ws://127.0.0.1:2000/rust"
they are running on different ports, but share the same port in production.
"wss://waterdragen.onrender.com/python"
"wss://waterdragen.onrender.com/rust"
how can I run my web service and connect to the websockets on Render?

Hi there,

You cannot expose two ports to our public HTTP proxy from a single service. If your service needs to run from two ports you will need to run your own proxy to direct traffic from the single port exposed to a public HTTP proxy to the internal ports your service uses.

Alternatively, you need to run your Rust and Python applications as separate services.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.