Socket IO and Traefik Scale Help

Can I get your help with scaling socket io? As soon as I scale the instance of socket io with these labels the server with site works but if I connect socket from localhost it doesn't work.

    labels:
      - "traefik.http.routers.service.rule=Host(`abc.com`)"
      - "traefik.docker.network=web"
      - "traefik.http.routers.service.entrypoints=websecure"
      - "traefik.http.routers.service.tls.certresolver=myhttpchallenge"
      - "traefik.http.routers.service.rule=PathPrefix(`/`)"
      - traefik.http.services.service.loadbalancer.sticky.cookie.name=server_id
      - traefik.http.services.serviceloadbalancer.sticky.cookie.httpOnly=true
      - traefik.http.services.service.loadbalancer.server.port=3001

Socket io server config

const io = require("socket.io")(
  server,
  process.env.MODE === "DEVELOPMENT" || process.env.MODE === "STAGING"
    ? {
        origins: ["http://localhost:3014", "https://abc.com"],
      }
    : {}
);

Hi @geeek

Your rule is only for abc.com so only requests for that host would be served by it and on https.

You would need to define another route for http port 3014 and have traefik expose the port, have an entrypoint, etc.