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

79
Visualizações
Local http/https request via Javascript with PHP

I want to make requests to an esp32 at the clients location (local-network). The Idea is to control an esp32 via the webbrowser. I want to use PHP for the backend. How can I control the esp32 without using a forwarded port.

My idea was to let a javascript-script make the http call to the local-ip from the esp32 with a simple http server on it. Localy it worked, but I wondered if this is still working if the server is outside of my local network, but I dont have a webserver, so ive uploaded a test file to github pages and tried to access my esp32 via githubpages. But unfortunately the request got blocked:

Even though the initial HTML page is loaded over a secure HTTPS connection, some resources like images, stylesheets or scripts are being accessed over an insecure HTTP connection. Usage of insecure resources is restricted to strengthen the security of your entire site. To resolve this issue, load all resources over a secure HTTPS connection.

Ive installed a basic https server on the esp32: https://techtutorialsx.com/2019/04/07/esp32-https-web-server/

but i got the same error again.The request is made in this code:

document.write("Mate");
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://ip_esp32/", false);

xmlHttp.send(null);
document.write("Try:" + xmlHttp.responseText);

How can I make a request with javascript without using Node.js? If this is not possible, can I controll the local esp32 otherwise with PHP?

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