How to create a https server on localhost

前端 未结 6 491
误落风尘
误落风尘 2021-01-30 08:47

I followed the tutorial below to create a https server https://docs.nodejitsu.com/articles/HTTP/servers/how-to-create-a-HTTPS-server/

and the program runs without errors

6条回答
  •  攒了一身酷
    2021-01-30 09:29

    Well one quick way to do this is with ngrok.

    It's really easy to use and only takes few secs to run. It is as simple as downloading your system version. Unzip and run ngrok.exe. It will open a command line type of window. Make sure your Apache server or the one you use is running.

    Then to only listen on an HTTPS tunnel endpoint run the following

    ngrok http -bind-tls=true site.dev:80
    

    or on whatever port you need https to be installed.

    Open browser and type https://localhost/myApp you will see it works.

    And if you type http://localhost/myApp it also works.

    Hope this is helpful to anyone for a fast solution.

提交回复
热议问题