mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
0.3.0
- 增加到期时间限制 - 新增配置面板 https 访问后,http 自动跳转 https(同端口) - 降低获取系统连接数的 cpu 使用率 - 优化界面 - VMess 协议 alterId 默认改为 0 - 修复旧版本 iOS 系统白屏问题 - 修复重启面板后 xray 没有启动的问题
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
"x-ui/logger"
|
||||
"x-ui/util/sys"
|
||||
"x-ui/xray"
|
||||
)
|
||||
|
||||
@@ -142,18 +143,14 @@ func (s *ServerService) GetStatus(lastStatus *Status) *Status {
|
||||
logger.Warning("can not find io counters")
|
||||
}
|
||||
|
||||
tcpConnStats, err := net.Connections("tcp")
|
||||
status.TcpCount, err = sys.GetTCPCount()
|
||||
if err != nil {
|
||||
logger.Warning("get connections failed:", err)
|
||||
} else {
|
||||
status.TcpCount = len(tcpConnStats)
|
||||
logger.Warning("get tcp connections failed:", err)
|
||||
}
|
||||
|
||||
udpConnStats, err := net.Connections("udp")
|
||||
status.UdpCount, err = sys.GetUDPCount()
|
||||
if err != nil {
|
||||
logger.Warning("get connections failed:", err)
|
||||
} else {
|
||||
status.UdpCount = len(udpConnStats)
|
||||
logger.Warning("get udp connections failed:", err)
|
||||
}
|
||||
|
||||
if s.xrayService.IsXrayRunning() {
|
||||
@@ -265,7 +262,7 @@ func (s *ServerService) UpdateXray(version string) error {
|
||||
|
||||
s.xrayService.StopXray()
|
||||
defer func() {
|
||||
err := s.xrayService.RestartXray()
|
||||
err := s.xrayService.RestartXray(true)
|
||||
if err != nil {
|
||||
logger.Error("start xray failed:", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user