var https=require("https");//https服务 var fs= require("fs"); var Koa = require('koa'); var enforceHttps = require('koa-sslify').default; var app = new Koa(); app.use(enforceHttps()); var options = { key: fs.readFileSync('./2_xxx.key'), cert: fs.readFileSync('./1_xxx_bundle.crt') } https.createServer(options, app.callback()).listen(5300); console.log('服务器运行中')