Skip to content

How to listen on multiple sockets? #1890

Answered by jebrosen
cmcqueen asked this question in Questions
Discussion options

You must be logged in to vote

Those options have a pretty wide range of solutions! Here are a few rough ideas that may help:

  • Each Rocket server can only "listen" on one address. But, under some operating system versions and configurations, listening on specific addresses such as [::] listens on both IPv4 and IPv6.
  • You could run multiple Rocket servers with different configurations for address/port, but with the same routes mounted.
  • You could use a reverse proxy (such as HAProxy or nginx) to listen on multiple ports, redirecting them to the same (or different) web servers.
  • You could run multiple Rocket servers in the same process, by using launch(). launch() returns a Future that can be spawn()ed or select!ed with oth…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cmcqueen
Comment options

Answer selected by cmcqueen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants