easynode/server/README.md
2024-07-29 13:56:41 +08:00

32 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 面板服务端
- 基于Koa
## 遇到的问题
> MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 input listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
- ssh连接数过多(默认最多11个)
- 每次连接新建一个vps实例断开则销毁
> Error signing data with key: error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
- 经比对ssh的rsa密钥在前端往后端的存储过程中丢失了部分字符
> 获取客户端信息跨域请求客户端系统信息建立ws socket实时更新网络
- 问题服务端前端套上https后前端无法请求客户端(http)的信息, 也无法建立ws socket连接(原因是https下无法建立http/ws协议请求)
- 方案1: 所有客户端与服务端通信,再全部由服务端与前端通信(考虑:服务端/客户端性能问题). Node实现http+https||nginx转发实现https
- 方案2: 给所有客户端加上https(客户端只有ip没法给个人ip签订证书)
## 构建运行包
### 坑
> log4js: 该module使用到了fs.mkdir()等读写apipkg打包后的环境不支持设置保存日志的目录需使用process.cwd()】
> win闪退: 在linux机器上构建可查看输出日志
## 客户端
> **构建客户端服务, 后台运行** `nohup ./easynode-server &`
> 功能服务器基本信息【ssh信息保存在主服务器】