rawmind0/alpine-traefik

Two ports for a single service.

racerxdl opened this issue · 2 comments

I have here a service that uses a http port and a websocket port. How to expose both through traefik?

@racerxdl Normally a websocket port is used under port 80, or 443 (https), and for security, it's best used under an https connection.

Most of the time a websocket connection is pushed through those ports along with a normal http connection, if the software that your using is implemented in that manner.

If you are using a different port, then you may want to try to have segment labels under the container you are using, this should allow for multiple ports within the container you are trying to connect too.

Traefik segment labels under Rancher you are going to want to make sure you are running the latest version of Traefik for full support of the labels (1.6).

Also, you want to make sure if you are running https, that the websocket configuration is also running through a secure channel, usually that's a wss:// connection.

If you have more details on what you are trying to do, it would be more helpful to understand your issue.

Hi @refusetofeel,

Thanks for the answer. Yeah, I want it to run over SSL, is just that this specific service has different ports for both Websocket and HTTP. I haven't saw that Segment Labels for Traefik, that looks the thing I was looking for. Thanks! 👍