Access Geolocation on Safari for locally hosted website across local network

26 Views Asked by At

I'm running a php site on a MacBook using the following code which uses geolocation.

php -S 0.0.0.0:8888

I can access this using any of the follow on my MacBook using Safari

http://127.0.0.1:8888
http://localhost:8888
http://192.168.1.25:8888

However geolocation doesn't work on http://192.168.1.25:8888 and I get the following error in the console on Safari

[Error] [blocked] Access to geolocation was blocked over insecure connection to http://192.168.1.25:8888.
Error getting location:"Origin does not have permission to use Geolocation service"

I'm wanting to be able to access this on an iPad on my local network, which I can access using the below IP and port.

http://192.168.1.25:8888

However as this uses safari I am facing the same issue that geolocation is blocked.

From looking online I can see that Safari appears to block geolocation on what it deems are insecure sites. Is there any way I can get this to work locally?

0

There are 0 best solutions below