Search code examples
javascriptgoogle-chromessllocalhostgetusermedia

JavaScript GetUserMedia using Chrome with localhost without HTTPS


I didn't know how to express it in the title, but I'm having an issue with Chrome.

I'm trying to use GetUserMedia() and GetPosition() in Chrome. I know that it requires SSL certification first, unless you're on localhost. The thing is, I can't try my project on my computer, so I must use my smart phone, and in order to access localhost through my smartphone, I must use the machine's IP address (192.168.1.4). The problem is that Chrome doesn't consider this IP address as localhost, so it requires an SSL certificate.

Is there any way I can test my project on my smartphone without having to install an SSL certififcate?


Solution

  • You can use a service like https://ngrok.com/ to map a public DNS address with SSL certificate to a port on your local machine.