简体   繁体   English

端口 443 在 https node express 上不工作

[英]port 443 not working on https node express

I'm running a https example server on node.js with express.我正在使用 express 在node.js上运行一个 https 示例服务器。

I have my certificates and I'm able to run it on port 3000 or 8443. But I have to put the port on the domain mydomine.com:8443 and if I want to access the https without saying the port, that should be 443, but this port doesn't load.我有我的证书,我可以在端口 3000 或 8443 上运行它。但是我必须将端口放在域mydomine.com:8443上,如果我想访问 https 而不说端口,那应该是 443 ,但此端口不加载。

I even tried changing the ports on my router to point to a working port, such as ext443->in8443, but that didn't work either.我什至尝试更改路由器上的端口以指向工作端口,例如 ext443->in8443,但这也不起作用。 (ports configuration) (端口配置)

So I'm wondering if it's really 443 that I'm looking for?所以我想知道我要找的是否真的是 443?

var fs = require('fs');
var http = require('http');
var https = require('https');
var privateKey  = fs.readFileSync(__dirname + 'ssl/privkey.pem', 'utf8');
var certificate = fs.readFileSync(__dirname + 'ssl/fullchain.pem', 'utf8');

var credentials = {key: privateKey, cert: certificate};
var express = require('express');
var app = express();

var httpsServer = https.createServer(credentials, app);

app.use(express.static('public')); 
httpsServer.listen(8443);

i even trdied mydomine.com:443 and doent work either我什至尝试了mydomine.com:443并且也没有工作

443 requires sudo on linux, and admin permissions on Windows, because it's reserved. 443 需要 linux 上的 sudo 和 Windows 上的管理员权限,因为它是保留的。 You can run this program as sudo.您可以使用 sudo 运行此程序。
If it didn't helpful, please, attach screenshot如果没有帮助,请附上屏幕截图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM