因此,对于本地托管,我使用server.listen(5000);而不是server.listen(443,'151.101.65.195');而且效果很好。但是对于我的实际网页,我使用了该网页的IP地址和正确的端口号443,即“ 151.101.65.195”,因此无法正常工作。你能告诉我为什么吗?
const function = require('firebase-functions');
const express = require('express');
var http = require('http');
var fs = require('fs');
const app = express();
var server = http.createServer(function(req, res){
res.writeHead(200, {'Content-Type': 'text/html'});
var myReadStream = fs.createReadStream(__dirname + '/index.html',
'utf8');
myReadStream.pipe(res);
});
app.get('/', (request, response) => {
});
exports.what = function.https.onRequest(app);
server.listen(443, '151.101.65.195');