Traefik: Unable to made Websockets works

Created on 21 Feb 2017  路  3Comments  路  Source: traefik/traefik

What version of Traefik are you using (traefik version)?

v1.1.2

What is your environment & configuration (arguments, toml...)?

Traefik run as a service in a Docker Swarm cluster.
Cluster is made of 2 Debian Jessie (8.6) virtual machines. Docker version is 1.12.3.

The Traefik service is run with the following command.

docker service create \
 --name traefik \
 --publish 80:80 --publish 443:443 --publish 8080:8080 \
 --label traefik.frontend.entryPoints=http,https,ws,wss \
 --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
 --mount type=bind,source=/DATA/WEB/traefik/traefik.toml,target=/etc/traefik/traefik.toml \
 --mount type=bind,source=/DATA/WEB/traefik/certs,target=/certs \
 --network my-network \
 --mode global \
 traefik \
 --docker \
 --docker.swarmmode \
 --docker.domain=swarm.mydomain.net \
 --docker.watch \
 --logLevel=DEBUG \
 --web

The traefik.toml file configuration is :

logLevel = "DEBUG"
debug = true
defaultEntryPoints = ["http", "https","ws","wss"]

[entryPoints]
 [entryPoints.http]
 address = ":80"
 compress = false
   [entryPoints.http.redirect]
      entryPoint = "https"
 [entryPoints.https]
 address = ":443"
 compress = false
 [entryPoints.https.tls]

[acme]
email = "[email protected]"
storageFile = "/certs/acme.json"
entryPoint = "https"
onDemand = true


[[acme.domains]]
 main = "swarm.mydomain.net"

[web]
address = ":8080"

What did you do?

I use Traefik as reverse proxy for other services and to manage Let's Encrypt certificates.
One of the services is a Mattermost instance, running with the following command.

docker service create \
--name mattermost \
--replicas 1 \
--label traefik.port=80 \
--label traefik.frontend.rule=Host:team.mydomain.net \
--label traefik.backend.loadbalancer.sticky=true \
--label traefik.frontend.passHostHeader=true \
--label traefik.frontend.entryPoints=http,https,ws,wss \
--mount type=bind,source=/DATA/MIDDLE/mattermost/config,target=/mattermost/config \
--mount type=bind,source=/DATA/MIDDLE/mattermost/data,target=/mattermost/data \
--mount type=bind,source=/etc/localtime,target=/etc/localtime \
--network my-network \
--with-registry-auth \
registry.mydomain.net:5000/custom-mattermost

What did you expect to see?

Mattermost should works fine. Other services have no problem with Traefik (webservers essentially)

What did you see instead?

According to Mattermost issues we currently have, it seems that websockets are not working. Mattermost app works fine, there is only issues with functionalities which need websockets.

I think there is something to do with my configuration to fix this, but I didn't find any example/tutorial to set up websockets with Traefik.

arewebsocket statu5-frozen-due-to-age

Most helpful comment

There are already a bunch of websocket-related issues; we need to consolidate them into one and close the duplicates, but I don't think it's necessary to keep this one in particular open if the OP's problem was unrelated.

As far as documentation is concerned, there's already #1027.

All 3 comments

Was this resolved or why was it closed? I am having the same trouble.

My issue was on another part of my configuration, so I manage to made it works. But there is a lack of documentation about Traefik and websockets. We can re-open if someone want to work on documentation ?

There are already a bunch of websocket-related issues; we need to consolidate them into one and close the duplicates, but I don't think it's necessary to keep this one in particular open if the OP's problem was unrelated.

As far as documentation is concerned, there's already #1027.

Was this page helpful?
0 / 5 - 0 ratings