mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-11-27 11:50:09 +00:00
Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
327df8cab6 | ||
|
|
954be11647 | ||
|
|
aff6768ff6 | ||
|
|
102b08a43b | ||
|
|
fb0aa5f490 | ||
|
|
616d0cdfff | ||
|
|
be4c958c42 | ||
|
|
e89218441e | ||
|
|
d8d4be325c | ||
|
|
633371418e | ||
|
|
5f5f576bb9 | ||
|
|
6040ccfc4b | ||
|
|
13268c52e0 | ||
|
|
050b429485 | ||
|
|
eaa8e2dc70 | ||
|
|
34f2c32ad1 | ||
|
|
2c4d03cb48 | ||
|
|
d8c1247cd8 | ||
|
|
3a351ee301 | ||
|
|
91892aefe9 | ||
|
|
2c8a8303cd |
@@ -63,14 +63,14 @@ func convertRuleSet(sourcePath string) error {
|
||||
return err
|
||||
}
|
||||
var outputPath string
|
||||
if flagRuleSetCompileOutput == flagRuleSetCompileDefaultOutput {
|
||||
if flagRuleSetConvertOutput == flagRuleSetCompileDefaultOutput {
|
||||
if strings.HasSuffix(sourcePath, ".txt") {
|
||||
outputPath = sourcePath[:len(sourcePath)-4] + ".srs"
|
||||
} else {
|
||||
outputPath = sourcePath + ".srs"
|
||||
}
|
||||
} else {
|
||||
outputPath = flagRuleSetCompileOutput
|
||||
outputPath = flagRuleSetConvertOutput
|
||||
}
|
||||
outputFile, err := os.Create(outputPath)
|
||||
if err != nil {
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
icon: material/alert-decagram
|
||||
---
|
||||
|
||||
#### 1.10.0-alpha.27
|
||||
|
||||
* Fixes and improvements
|
||||
|
||||
#### 1.10.0-alpha.25
|
||||
|
||||
* Add AdGuard DNS Filter support **1**
|
||||
|
||||
@@ -4,9 +4,9 @@ icon: material/alert-decagram
|
||||
|
||||
!!! quote "sing-box 1.10.0 中的更改"
|
||||
|
||||
:material-plus: [client](#client)
|
||||
:material-plus: [client](#client)
|
||||
:material-delete-clock: [rule_set_ipcidr_match_source](#rule_set_ipcidr_match_source)
|
||||
:material-plus: [rule_set_ip_cidr_match_source](#rule_set_ip_cidr_match_source)
|
||||
:material-plus: [rule_set_ip_cidr_match_source](#rule_set_ip_cidr_match_source)
|
||||
|
||||
!!! quote "sing-box 1.8.0 中的更改"
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ icon: material/new-box
|
||||
|
||||
!!! quote "Changes in sing-box 1.10.0"
|
||||
|
||||
:material-plus: QUIC client type detect support for QUIC
|
||||
:material-plus: Chromium support for QUIC
|
||||
:material-plus: BitTorrent support
|
||||
:material-plus: QUIC client type detect support for QUIC
|
||||
:material-plus: Chromium support for QUIC
|
||||
:material-plus: BitTorrent support
|
||||
:material-plus: DTLS support
|
||||
|
||||
If enabled in the inbound, the protocol and domain name (if present) of by the connection can be sniffed.
|
||||
|
||||
@@ -4,9 +4,9 @@ icon: material/new-box
|
||||
|
||||
!!! quote "sing-box 1.10.0 中的更改"
|
||||
|
||||
:material-plus: QUIC 的 客户端类型探测支持
|
||||
:material-plus: QUIC 的 Chromium 支持
|
||||
:material-plus: BitTorrent 支持
|
||||
:material-plus: QUIC 的 客户端类型探测支持
|
||||
:material-plus: QUIC 的 Chromium 支持
|
||||
:material-plus: BitTorrent 支持
|
||||
:material-plus: DTLS 支持
|
||||
|
||||
如果在入站中启用,则可以嗅探连接的协议和域名(如果存在)。
|
||||
|
||||
@@ -27,7 +27,7 @@ require (
|
||||
github.com/sagernet/quic-go v0.45.1-beta.2
|
||||
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691
|
||||
github.com/sagernet/sing v0.5.0-alpha.13.0.20240726000009-a2f9fef93663
|
||||
github.com/sagernet/sing-dns v0.3.0-beta.12
|
||||
github.com/sagernet/sing-dns v0.3.0-beta.14
|
||||
github.com/sagernet/sing-mux v0.2.0
|
||||
github.com/sagernet/sing-quic v0.2.0-beta.12
|
||||
github.com/sagernet/sing-shadowsocks v0.2.7
|
||||
|
||||
@@ -117,8 +117,8 @@ github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4Wk
|
||||
github.com/sagernet/sing v0.2.18/go.mod h1:OL6k2F0vHmEzXz2KW19qQzu172FDgSbUSODylighuVo=
|
||||
github.com/sagernet/sing v0.5.0-alpha.13.0.20240726000009-a2f9fef93663 h1:BrOz4sPkDVvOxtcup8P3Fh9b9tk/lZyAMl+gkGEOLEE=
|
||||
github.com/sagernet/sing v0.5.0-alpha.13.0.20240726000009-a2f9fef93663/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
|
||||
github.com/sagernet/sing-dns v0.3.0-beta.12 h1:mdTsaVU+0jopEKUDLwLmo8AbiSGZOly97oSPBDX3O8I=
|
||||
github.com/sagernet/sing-dns v0.3.0-beta.12/go.mod h1:rscgSr5ixOPk8XM9ZMLuMXCyldEQ1nLvdl0nfv+lp00=
|
||||
github.com/sagernet/sing-dns v0.3.0-beta.14 h1:/s+fJzYKsvLaNDt/2rjpsrDcN8wmCO2JbX6OFrl8Nww=
|
||||
github.com/sagernet/sing-dns v0.3.0-beta.14/go.mod h1:rscgSr5ixOPk8XM9ZMLuMXCyldEQ1nLvdl0nfv+lp00=
|
||||
github.com/sagernet/sing-mux v0.2.0 h1:4C+vd8HztJCWNYfufvgL49xaOoOHXty2+EAjnzN3IYo=
|
||||
github.com/sagernet/sing-mux v0.2.0/go.mod h1:khzr9AOPocLa+g53dBplwNDz4gdsyx/YM3swtAhlkHQ=
|
||||
github.com/sagernet/sing-quic v0.2.0-beta.12 h1:BhvA5mmrDFEyDUQB5eeu+9UhF+ieyuNJ5Rsb0dAG3QY=
|
||||
|
||||
+1
-21
@@ -4,13 +4,10 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
C "github.com/sagernet/sing-box/constant"
|
||||
"github.com/sagernet/sing-box/log"
|
||||
"github.com/sagernet/sing/common/buf"
|
||||
"github.com/sagernet/sing/common/bufio"
|
||||
M "github.com/sagernet/sing/common/metadata"
|
||||
N "github.com/sagernet/sing/common/network"
|
||||
)
|
||||
@@ -49,24 +46,7 @@ func (h *Block) NewConnection(ctx context.Context, conn net.Conn, metadata adapt
|
||||
}
|
||||
|
||||
func (h *Block) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error {
|
||||
conn.Close()
|
||||
h.logger.InfoContext(ctx, "blocked packet connection to ", metadata.Destination)
|
||||
writer := &discardPacketWriter{
|
||||
timer: time.AfterFunc(C.UDPTimeout, func() {
|
||||
_ = conn.Close()
|
||||
}),
|
||||
}
|
||||
_, _ = bufio.CopyPacket(writer, conn)
|
||||
return nil
|
||||
}
|
||||
|
||||
type discardPacketWriter struct {
|
||||
timer *time.Timer
|
||||
}
|
||||
|
||||
func (w *discardPacketWriter) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error {
|
||||
if w.timer.Stop() {
|
||||
w.timer.Reset(C.UDPTimeout)
|
||||
}
|
||||
buffer.Release()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user