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

138
Visualizações
Firefox can’t establish a connection to the server at https://example.com

I have a webserver and I want to implement server-event Source via: EventSource("API.php") but I ran into error on random requests! For example After 120 Requests I get the error or the other time after 31 requests! what is the problem and how to solve that?

Site CODE:

<!DocType 'html'>
<html>
<head></head>
<body>
<div id="result"></div>

<script>
if(typeof(EventSource) !== "undefined") {
  // Yes! Server-sent events support!
  // Some code.....
var source = new EventSource("Example.php");
source.onmessage = function(event) {
  document.getElementById("result").innerHTML += event.data + "<br>";
}; 


} else {
  alert("Use FireFox to Load This Page! Your Browser is not supported...")
} 


</script>

</body>
<footer></footer>
</html>

sample image

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This ("521") is apparently a cloudflare-specific error. So your problem is server-side, not with your JavaScript.

There are plenty of suggestions online; I suggest your search terms should be "cloudflare 521". Or "cloudflare server sent events". Don't search for "cloudflare SSE" as that abbreviation has multiple meanings in that context.

It seems what people normally do is create a rule to not use Cloudflare for your SSE endpoints.

about 4 years ago · Juan Pablo Isaza Relatório
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