Compare commits

...

5 Commits
v1.0 ... v1.0.1

Author SHA1 Message Date
世界
f7bed32c6f Bump version 2022-09-09 14:43:42 +08:00
世界
ef7f2d82c0 Fix match 4in6 address in ip_cidr 2022-09-09 14:07:02 +08:00
世界
7aa97a332e Fix documentation 2022-09-09 13:54:02 +08:00
世界
7c30dde96b Minor fixes 2022-09-08 18:33:59 +08:00
GyDi
9cef2a0a8f Fix clashapi log level format error 2022-09-08 18:04:06 +08:00
8 changed files with 26 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
package constant
var (
Version = "1.0"
Version = "1.0.1"
Commit = ""
)

View File

@@ -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

View File

@@ -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 |

View File

@@ -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
```
| 构建标志 | 描述 |

View File

@@ -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{

View File

@@ -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())

View File

@@ -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
}

View File

@@ -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()