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"],
}
: {}
);