如何在localhost上创建https服务器 [英] How to create a https server on localhost

查看:897
本文介绍了如何在localhost上创建https服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照下面的教程创建了一个https服务器

解决方案

好一个快速执行此操作的方法是使用 ngrok



它非常易于使用,只需几秒即可运行。它就像下载您的系统版本一样简单。解压缩并运行 ngrok.exe 。它将打开命令行类型的窗口。确保您的Apache服务器或您使用的服务器正在运行。



然后只监听HTTPS隧道端点运行以下

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

或您需要的任何端口 https 即可安装。



打开浏览器并输入 https:// localhost / myApp 您将看到它有效。



如果你输入 http:// localhost / myApp 它也可以。



希望这对任何人都有帮助,以便快速解决问题。


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

but when I can not open https://localhost:8000 in my chrome

it always get a ERR_SSL_PROTOCOL_ERROR

解决方案

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.

这篇关于如何在localhost上创建https服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆