文件名称:self-signed-https:创建自签名 https 服务器
文件大小:4KB
文件格式:ZIP
更新时间:2024-07-24 02:47:28
LiveScript
自签名-https 创建自签名 https 服务器 安装 npm install self-signed-https 用法 一个用 express 编写的基本 HTTPS hello world 应用程序(粘贴到 app.js 中): var express = require ( 'express' ) var selfSignedHttps = require ( 'self-signed-https' ) var app = express ( ) app . get ( '/' , function ( req , res ) { res . send ( 'hello world' ) } ) selfSignedHttps ( app ) . listen ( 443 , '0.0.0.0' ) 您需要以 root 身份运行,因为它正在侦听端口 443(如果您
【文件预览】:
self-signed-https-master
----self-signed-https.ls(738B)
----server.crt(757B)
----self-signed-https.js(544B)
----README.md(713B)
----server.key(887B)
----package.json(598B)