【文件属性】:
文件名称:http.https:在同一端口上服务HTTP和HTTPS
文件大小:19KB
文件格式:ZIP
更新时间:2021-05-24 08:07:27
JavaScript
httpx
在同一端口上服务HTTP和HTTPS。
安装
npm install --save http.https
或者
yarn add http.https
用法
参见示例文件夹。 请注意,您将需要SSL证书来运行这些示例。 可以生成临时的自签名证书,如下所示:
cd examples
openssl genrsa -out example.key 2048
openssl req -new -out example.csr -key example.key
openssl x509 -req -in example.csr -signkey example.key -out example.crt
该示例取决于Express和SocketIO。 这些可以如下安装:
cd examples
npm install
npm start
服务器运行时,可以通过浏览器中的或进
【文件预览】:
http.https-master
----yarn.lock(86B)
----.vscode()
--------launch.json(482B)
----examples()
--------public()
--------yarn.lock(24KB)
--------express_server.js(2KB)
--------package.json(345B)
----LICENSE(11KB)
----README.md(797B)
----.gitignore(58B)
----http.https.js(1024B)
----package.json(709B)