I'm using waitress
to serve my Django app. I need it to serve the app on two ports simultaneously, in the same thread. (Can't be on a separate process because I need to be able to run it in my debugger in development.)
How can I do that?
The latest version of waitress is now able to listen on multiple sockets, including IPv4 and IPv6.
Instead of passing in a host/port combination you now provide waitress
with a space delineated list, and it will create as many sockets as required.
from waitress import serve
serve(wsgiapp, listen='0.0.0.0:8080 [::]:9090 *:6543')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With