Testing web apps that require https, like WebRTC and getUserMedia

You’re developing a web app on localhost. It uses one of the many Web APIs that require your page to come from an https origin (or from localhost). getUserMedia(), WebRTC, and the Web Authentication API are examples.

The hard way

Now you want to show it to a friend. Now what? Do you have to do all this?

  1. Register a doman
  2. Set up a server machine or VM
  3. Set up a web server on that machine
  4. Configure LetsEncrypt to deliver your https certificate
  5. Deploy your app to that server

Ouch! There went half a day. Just to show somebody a simple app.

But there are easier ways to deploy simple web apps over https.

The easy way using Glitch

Using glitch.com is a good and quick way to do this. Create a free Glitch account. Then you can create your own glitch project, or you can remix an existing project.

There’s a well-known set of WebRTC samples on Github showing how to use the APIs requiring https (thanks to the WebRTC team).

I put a version of it on Glitch. You can run it here. You can remix it here, to make it your own.

The easy way using Heroku

You can deploy your web app to Heroku as well.  Create a free Heroku account. Then putting your app on Heroku is as easy as pushing your app’s git repository.

Leave a Comment