Initial commit - full huishou project

This commit is contained in:
jiapengyu
2026-07-27 14:07:26 +08:00
commit 60790ad1b3
39127 changed files with 5989265 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
import { Client } from 'ssh2';
const conn = new Client();
conn.on('ready', () => {
console.log('=== 测试HTTPS链接 ===\n');
conn.exec('curl -s -k https://hs.yifenbao.cn/api/prices | head -20', (err, stream) => {
if (err) {
console.log('API测试失败:', err.message);
conn.end();
return;
}
stream.on('data', (data) => {
console.log('API响应:', data.toString());
});
stream.on('close', () => {
conn.exec('curl -s -k https://hs.yifenbao.cn/ | head -50', (err, stream2) => {
if (err) {
console.log('首页测试失败:', err.message);
conn.end();
return;
}
stream2.on('data', (data) => {
console.log('\n首页响应:', data.toString());
});
stream2.on('close', () => {
conn.end();
});
});
});
});
});
conn.on('error', (err) => {
console.log('连接错误:', err.message);
});
conn.connect({
host: 'hs.yifenbao.cn',
port: 22,
username: 'root',
password: 'Torch1112'
});