Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

75
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!