socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

“transport disconnect close” when use socketio&socketio-redisadapter,nginx ingress in k3s

Open HOLYYUN opened this issue 3 years ago • 3 comments
trafficstars

this is error report image this is my ingress config

apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: CI_PROJECT_NAME annotations: kubernetes.io/ingress.class: "nginx" #nginx.ingress.kubernetes.io/ssl-redirect: "true" #nginx.ingress.kubernetes.io/force-ssl-redirect: "true" #nginx.ingress.kubernetes.io/use-regex: "true" #nginx.ingress.kubernetes.io/proxy-body-size: 100m # ip hash nginx.ingress.kubernetes.io/upstream-hash-by: "$http_x_forwarded_for" spec: tls: - hosts: - HOST_URL secretName: cluster-holyyun-tls rules: - host: HOST_URL http: paths: - path: / pathType: Prefix backend: service: name: CI_PROJECT_NAME port: number: 3000

It`s worked sometimes,but when the client connected a span,this error happen。 this is my client&server config

socket = io(socketUrl + data.data.namespace, { query: { token: data.data.token, userId: userId }, transports: ["polling", "websocket"] })

io.adapter(createAdapter(pubClient, subClient));

HOLYYUN avatar Dec 17 '21 09:12 HOLYYUN

It looks like you are not able to reach the Socket.IO server. Were you eventually able to find a solution?

darrachequesne avatar Dec 17 '21 21:12 darrachequesne

It looks like you are not able to reach the Socket.IO server. Were you eventually able to find a solution?

but sometimes it worked in the same ingress config,when i restart the cluster of socket.io,it will lose connection and can't connected again,the problem happend. sometimes the client connected too long,the problem would happen also, there's no solution or example for cluster of ingress.

HOLYYUN avatar Dec 18 '21 14:12 HOLYYUN

That sounds weird. I'll try to add an example with a k3s cluster.

darrachequesne avatar Jan 03 '22 08:01 darrachequesne