const express = require('express'); const app = express(); const PORT = 80; // 简单测试页面 app.get('/', (req, res) => { res.send(`
服务器: 43.161.248.209:80
时间: ${new Date().toISOString()}
如果端口5000无法访问,可能是安全组阻止。请检查腾讯云安全组规则,确保端口5000已开放。
`); }); // 启动服务器(需要root权限) if (PORT === 80) { console.log('⚠️ 端口80需要root权限,使用sudo运行'); app.listen(PORT, '0.0.0.0', () => { console.log(`测试服务器运行在: http://0.0.0.0:${PORT}`); }); } else { app.listen(PORT, '0.0.0.0', () => { console.log(`测试服务器运行在: http://0.0.0.0:${PORT}`); }); }