-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 增加到期时间限制 - 新增配置面板 https 访问后,http 自动跳转 https(同端口) - 降低获取系统连接数的 cpu 使用率 - 优化界面 - VMess 协议 alterId 默认改为 0 - 修复旧版本 iOS 系统白屏问题 - 修复重启面板后 xray 没有启动的问题
- Loading branch information
Showing
22 changed files
with
473 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2.0 | ||
0.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package sys | ||
|
||
import ( | ||
_ "unsafe" | ||
) | ||
|
||
//go:linkname HostProc github.com/shirou/gopsutil/internal/common.HostProc | ||
func HostProc(combineWith ...string) string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// +build darwin | ||
|
||
package sys | ||
|
||
import ( | ||
"github.com/shirou/gopsutil/net" | ||
) | ||
|
||
func GetTCPCount() (int, error) { | ||
stats, err := net.Connections("tcp") | ||
if err != nil { | ||
return 0, err | ||
} | ||
return len(stats), nil | ||
} | ||
|
||
func GetUDPCount() (int, error) { | ||
stats, err := net.Connections("udp") | ||
if err != nil { | ||
return 0, err | ||
} | ||
return len(stats), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// +build linux | ||
|
||
package sys | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"io" | ||
"os" | ||
) | ||
|
||
func getLinesNum(filename string) (int, error) { | ||
file, err := os.Open(filename) | ||
if err != nil { | ||
return 0, err | ||
} | ||
defer file.Close() | ||
|
||
sum := 0 | ||
buf := make([]byte, 8192) | ||
for { | ||
n, err := file.Read(buf) | ||
|
||
var buffPosition int | ||
for { | ||
i := bytes.IndexByte(buf[buffPosition:], '\n') | ||
if i < 0 || n == buffPosition { | ||
break | ||
} | ||
buffPosition += i + 1 | ||
sum++ | ||
} | ||
|
||
if err == io.EOF { | ||
return sum, nil | ||
} else if err != nil { | ||
return sum, err | ||
} | ||
} | ||
} | ||
|
||
func GetTCPCount() (int, error) { | ||
root := HostProc() | ||
|
||
tcp4, err := getLinesNum(fmt.Sprintf("%v/net/tcp", root)) | ||
if err != nil { | ||
return tcp4, err | ||
} | ||
tcp6, err := getLinesNum(fmt.Sprintf("%v/net/tcp6", root)) | ||
if err != nil { | ||
return tcp4 + tcp6, nil | ||
} | ||
|
||
return tcp4 + tcp6, nil | ||
} | ||
|
||
func GetUDPCount() (int, error) { | ||
root := HostProc() | ||
|
||
udp4, err := getLinesNum(fmt.Sprintf("%v/net/udp", root)) | ||
if err != nil { | ||
return udp4, err | ||
} | ||
udp6, err := getLinesNum(fmt.Sprintf("%v/net/udp6", root)) | ||
if err != nil { | ||
return udp4 + udp6, nil | ||
} | ||
|
||
return udp4 + udp6, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
292d5b8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x-ui/web/assets/js/model/xray.js
Line 1183 in 5d86891
大佬,容我多个需求
就是类似于fallback这样 ,可以在同一个bind port上绑定多个UUID,可以增删的那种。(可能会影响到多个UUID的流量统计,可能会整复杂了)
这种主要是为了解决伪装时可以不用bind多个端口。
作者看来被各种小白问题惹恼了。。。如果不愿意写的话等我去学学js。。。。
............................
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "xxxxxx",
"flow": "xtls-rprx-direct",
"level": 0,
"email": "xxxxxx"
},
{
"id": "xxxxx",
"flow": "xtls-rprx-direct",
"level": 0,
"email": "xxxxxxx"
}
]
...................................