32 lines
1.2 KiB
JavaScript
32 lines
1.2 KiB
JavaScript
const { Client } = require('ssh2');
|
|
|
|
const conn = new Client();
|
|
|
|
conn.on('ready', () => {
|
|
console.log('=== 检查HTTPS完整响应 ===');
|
|
|
|
conn.exec('curl -sL https://hs.yifenbao.cn/ | head -10', (err, stream) => {
|
|
if (err) { console.log('ERR:', err); conn.end(); return; }
|
|
let html = '';
|
|
stream.on('data', (d) => html += d.toString());
|
|
stream.on('close', () => {
|
|
console.log(html);
|
|
|
|
console.log('\n=== 检查HTTPS资源 ===');
|
|
conn.exec('curl -s -o /dev/null -w "%{http_code}" https://hs.yifenbao.cn/assets/index-Cs60smgB.js', (err2, stream2) => {
|
|
if (err2) { console.log('ERR2:', err2); conn.end(); return; }
|
|
stream2.on('data', (d) => console.log('HTTPS JS状态码:', d.toString().trim()));
|
|
stream2.on('close', () => {
|
|
console.log('\n=== 检查Nginx容器最新日志 ===');
|
|
conn.exec('docker logs huishou 2>&1 | tail -10', (err3, stream3) => {
|
|
if (err3) { console.log('ERR3:', err3); conn.end(); return; }
|
|
stream3.on('data', (d) => console.log(d.toString()));
|
|
stream3.on('close', () => conn.end());
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
conn.connect({ host: 'hs.yifenbao.cn', port: 22, username: 'root', password: 'Torch1112' }); |