mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-12 01:57:18 +10:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7bed32c6f | ||
|
|
ef7f2d82c0 | ||
|
|
7aa97a332e | ||
|
|
7c30dde96b | ||
|
|
9cef2a0a8f |
@@ -1,6 +1,6 @@
|
||||
package constant
|
||||
|
||||
var (
|
||||
Version = "1.0"
|
||||
Version = "1.0.1"
|
||||
Commit = ""
|
||||
)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
#### 1.0.1
|
||||
|
||||
* Fix match 4in6 address in ip_cidr
|
||||
* Fix clash api log level format error
|
||||
* Fix clash api unknown proxy type
|
||||
|
||||
#### 1.0
|
||||
|
||||
* Fix wireguard reconnect
|
||||
|
||||
@@ -13,13 +13,13 @@ The universal proxy platform.
|
||||
sing-box requires Golang **1.18.5** or a higher version.
|
||||
|
||||
```bash
|
||||
go install -v github.com/sagernet/sing-box/cmd/sing-box@v1.0-beta2
|
||||
go install -v github.com/sagernet/sing-box/cmd/sing-box@latest
|
||||
```
|
||||
|
||||
Install with options:
|
||||
|
||||
```bash
|
||||
go install -v -tags with_clash_api github.com/sagernet/sing-box/cmd/sing-box@v1.0-beta2
|
||||
go install -v -tags with_clash_api github.com/sagernet/sing-box/cmd/sing-box@latest
|
||||
```
|
||||
|
||||
| Build Tag | Description |
|
||||
|
||||
@@ -13,13 +13,13 @@ description: 欢迎来到该 sing-box 项目的文档页。
|
||||
sing-box 需要 Golang **1.18.5** 或更高版本。
|
||||
|
||||
```bash
|
||||
go install -v github.com/sagernet/sing-box/cmd/sing-box@v1.0-beta2
|
||||
go install -v github.com/sagernet/sing-box/cmd/sing-box@latest
|
||||
```
|
||||
|
||||
自定义安装:
|
||||
|
||||
```bash
|
||||
go install -v -tags with_clash_api github.com/sagernet/sing-box/cmd/sing-box@v1.0-beta2
|
||||
go install -v -tags with_clash_api github.com/sagernet/sing-box/cmd/sing-box@latest
|
||||
```
|
||||
|
||||
| 构建标志 | 描述 |
|
||||
|
||||
@@ -36,7 +36,7 @@ func getConfigs(logFactory log.Factory) func(w http.ResponseWriter, r *http.Requ
|
||||
logLevel := logFactory.Level()
|
||||
if logLevel == log.LevelTrace {
|
||||
logLevel = log.LevelDebug
|
||||
} else if logLevel > log.LevelError {
|
||||
} else if logLevel < log.LevelError {
|
||||
logLevel = log.LevelError
|
||||
}
|
||||
render.JSON(w, r, &configSchema{
|
||||
|
||||
@@ -75,11 +75,13 @@ func proxyInfo(server *Server, detour adapter.Outbound) *badjson.JSONObject {
|
||||
clashType = "Shadowsocks"
|
||||
case C.TypeVMess:
|
||||
clashType = "Vmess"
|
||||
case C.TypeTrojan:
|
||||
clashType = "Trojan"
|
||||
case C.TypeSelector:
|
||||
clashType = "Selector"
|
||||
isGroup = true
|
||||
default:
|
||||
clashType = "Unknown"
|
||||
clashType = "Socks"
|
||||
}
|
||||
info.Put("type", clashType)
|
||||
info.Put("name", detour.Tag())
|
||||
|
||||
@@ -59,13 +59,13 @@ func NewIPCIDRItem(isSource bool, prefixStrings []string) (*IPCIDRItem, error) {
|
||||
|
||||
func (r *IPCIDRItem) Match(metadata *adapter.InboundContext) bool {
|
||||
if r.isSource {
|
||||
return r.ipSet.Contains(metadata.Source.Addr)
|
||||
return r.match(metadata.Source.Addr)
|
||||
} else {
|
||||
if metadata.Destination.IsIP() {
|
||||
return r.ipSet.Contains(metadata.Destination.Addr)
|
||||
return r.match(metadata.Destination.Addr)
|
||||
} else {
|
||||
for _, address := range metadata.DestinationAddresses {
|
||||
if r.ipSet.Contains(address) {
|
||||
if r.match(address) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,14 @@ func (r *IPCIDRItem) Match(metadata *adapter.InboundContext) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *IPCIDRItem) match(address netip.Addr) bool {
|
||||
if address.Is4In6() {
|
||||
return r.ipSet.Contains(netip.AddrFrom4(address.As4()))
|
||||
} else {
|
||||
return r.ipSet.Contains(address)
|
||||
}
|
||||
}
|
||||
|
||||
func (r *IPCIDRItem) String() string {
|
||||
return r.description
|
||||
}
|
||||
|
||||
@@ -61,10 +61,6 @@ func (s *StreamWrapper) Upstream() any {
|
||||
return s.Stream
|
||||
}
|
||||
|
||||
func (s *StreamWrapper) WriterReplaceable() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (s *StreamWrapper) Close() error {
|
||||
s.CancelRead(0)
|
||||
s.Stream.Close()
|
||||
|
||||
Reference in New Issue
Block a user