Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

456
Visualizações
cross domain websocket connections fail in chrome, works in firefox

i recently started to face this problem on chrome,where i am not able to connect to a websocket which is hosted under a different domain.

Example use case:
consider a domain that is front-ended by load balancer -> lb.com with two datacenters -> lb-dc1 and lb-dc2.The application page is hosted from lb.com but the code in this page, will create a web socket connection to lb-dc1 or lb-dc2.

This works fine on firefox/safari, but this connection is failing on chrome.

You can also see this behavior one

https://www.websocket.org/echo.html

Where the test socket connection will fail on chrome (i am using latest 91.0 version) whereas it will work on firefox.

I have an nginx proxy to pass the WSS request.. it looks something like this

    location /socket {
      proxy_pass http://<my-service>:8080/socket;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "Upgrade";
      proxy_buffering off;
      proxy_ignore_client_abort off;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_read_timeout 86400;
      break;
    }



over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda