Compare commits

..

99 Commits

Author SHA1 Message Date
世界
0613431623 documentation: Bump version 2025-05-24 08:24:40 +08:00
世界
95aa5d05b7 Fix tailscale forward 2025-05-24 08:24:23 +08:00
世界
0ccfb8ad96 Minor fixes 2025-05-24 08:22:55 +08:00
世界
86fe2aee98 Update quic-go to v0.52.0 2025-05-24 08:22:55 +08:00
世界
1b2cce77f1 Add SSM API service 2025-05-24 08:22:55 +08:00
世界
4b1a283bbf Add resolved service and DNS server 2025-05-24 08:22:54 +08:00
世界
f91cbc0e42 Add DERP service 2025-05-24 08:22:54 +08:00
世界
7d1b88e1cd Add service component type 2025-05-24 08:22:54 +08:00
世界
a4ad775fb7 Fix tproxy tcp control 2025-05-24 08:22:54 +08:00
愚者
88bfc6fd77 release: Fix build tags for android
Signed-off-by: 愚者 <11926619+FansChou@users.noreply.github.com>
2025-05-24 08:22:54 +08:00
世界
cd8501736d prevent creation of bind and mark controls on unsupported platforms 2025-05-24 08:22:53 +08:00
PuerNya
cc05b89b59 documentation: Fix description of reject DNS action behavior 2025-05-24 08:22:53 +08:00
Restia-Ashbell
f8bfe56458 Fix TLS record fragment 2025-05-24 08:22:53 +08:00
世界
f9942b7c50 Add missing accept_routes option for Tailscale 2025-05-24 08:22:53 +08:00
世界
41915a6621 Add TLS record fragment support 2025-05-24 08:22:53 +08:00
世界
2d6894f28a release: Update Go to 1.24.3 2025-05-24 08:22:53 +08:00
世界
93ceb33780 Fix set edns0 client subnet 2025-05-24 08:22:52 +08:00
世界
f643e35d00 Update minor dependencies 2025-05-24 08:22:52 +08:00
世界
cbcc4f4cfb Update certmagic and providers 2025-05-24 08:22:52 +08:00
世界
feab546659 Update protobuf and grpc 2025-05-24 08:22:52 +08:00
世界
5a3be48d7b Add control options for listeners 2025-05-24 08:22:51 +08:00
世界
ef2f170364 Update quic-go to v0.51.0 2025-05-24 08:22:51 +08:00
世界
5022d9a924 Update utls to v1.7.2 2025-05-24 08:22:51 +08:00
世界
50d61c09cf Handle EDNS version downgrade 2025-05-24 08:22:50 +08:00
世界
bcc703310e documentation: Fix anytls padding scheme description 2025-05-24 08:22:50 +08:00
安容
a6c448e145 Report invalid DNS address early 2025-05-24 08:22:50 +08:00
世界
11105eb553 Fix wireguard listen_port 2025-05-24 08:22:49 +08:00
世界
18e240e5b3 clash-api: Add more meta api 2025-05-24 08:22:49 +08:00
世界
03bb284370 Fix DNS lookup 2025-05-24 08:22:48 +08:00
世界
bc63aa2254 Fix fetch ECH configs 2025-05-24 08:22:48 +08:00
reletor
abbe2f7eaf documentation: Minor fixes 2025-05-24 08:22:48 +08:00
caelansar
33d576a018 Fix callback deletion in UDP transport 2025-05-24 08:22:48 +08:00
世界
38e34c7719 documentation: Try to make the play review happy 2025-05-24 08:22:47 +08:00
世界
03d086c32e Fix missing handling of legacy domain_strategy options 2025-05-24 08:22:47 +08:00
世界
52de97edf1 Improve local DNS server 2025-05-24 08:22:46 +08:00
anytls
0e68b1a29e Update anytls
Co-authored-by: anytls <anytls>
2025-05-24 08:22:46 +08:00
世界
6b43758d8e Fix DNS dialer 2025-05-24 08:22:46 +08:00
世界
9957ab6e8b release: Skip override version for iOS 2025-05-24 08:22:46 +08:00
iikira
36aef228bf Fix UDP DNS server crash
Signed-off-by: iikira <i2@mail.iikira.com>
2025-05-24 08:22:45 +08:00
ReleTor
82ba228c39 Fix fetch ECH configs 2025-05-24 08:22:45 +08:00
世界
7acc036c6e Allow direct outbounds without domain_resolver 2025-05-24 08:22:44 +08:00
世界
78439340cf Fix Tailscale dialer 2025-05-24 08:22:44 +08:00
dyhkwong
7fd99aa515 Fix DNS over QUIC stream close 2025-05-24 08:22:44 +08:00
anytls
5d30bfabae Update anytls
Co-authored-by: anytls <anytls>
2025-05-24 08:22:44 +08:00
Rambling2076
c29d56699f Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-05-24 08:22:44 +08:00
世界
5c4518e6a4 Fail when default DNS server not found 2025-05-24 08:22:43 +08:00
世界
58bf4c1e85 Update gVisor to 20250319.0 2025-05-24 08:22:43 +08:00
世界
49d8408fdf Explicitly reject detour to empty direct outbounds 2025-05-24 08:22:43 +08:00
世界
01cbc4810a Add netns support 2025-05-24 08:22:43 +08:00
世界
d9b5ca3e82 Add wildcard name support for predefined records 2025-05-24 08:22:43 +08:00
世界
6c2b4dce4a Remove map usage in options 2025-05-24 08:22:42 +08:00
世界
daeb14bdd2 Fix unhandled DNS loop 2025-05-24 08:22:41 +08:00
世界
7d7aa4a328 Add wildcard-sni support for shadow-tls inbound 2025-05-24 08:22:40 +08:00
k9982874
f0f0b658f7 Add ntp protocol sniffing 2025-05-24 08:22:40 +08:00
世界
de2546f572 option: Fix marshal legacy DNS options 2025-05-24 08:22:40 +08:00
世界
fcb8171ff5 Make domain_resolver optional when only one DNS server is configured 2025-05-24 08:22:39 +08:00
世界
a53c6a906f Fix DNS lookup context pollution 2025-05-24 08:22:39 +08:00
世界
8637c536c8 Fix http3 DNS server connecting to wrong address 2025-05-24 08:22:38 +08:00
Restia-Ashbell
db7a0c6092 documentation: Fix typo 2025-05-24 08:22:38 +08:00
anytls
87d287dd56 Update sing-anytls
Co-authored-by: anytls <anytls>
2025-05-24 08:22:38 +08:00
k9982874
ee65df4dfc Fix hosts DNS server 2025-05-24 08:22:37 +08:00
世界
f9f5a0c724 Fix UDP DNS server crash 2025-05-24 08:22:37 +08:00
世界
96e81b6e76 documentation: Fix missing ip_accept_any DNS rule option 2025-05-24 08:22:37 +08:00
世界
883bea6628 Fix anytls dialer usage 2025-05-24 08:22:36 +08:00
世界
62b98fcc4c Move predefined DNS server to rule action 2025-05-24 08:22:36 +08:00
世界
c0d7198ac2 Fix domain resolver on direct outbound 2025-05-24 08:22:35 +08:00
Zephyruso
da1cdcb784 Fix missing AnyTLS display name 2025-05-24 08:22:35 +08:00
anytls
cd284a4368 Update sing-anytls
Co-authored-by: anytls <anytls>
2025-05-24 08:22:35 +08:00
Estel
33e9d719f8 documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-05-24 08:22:34 +08:00
TargetLocked
f0a3ba5bc8 Fix parsing legacy DNS options 2025-05-24 08:22:34 +08:00
世界
b96a6b595e Fix DNS fallback 2025-05-24 08:22:33 +08:00
世界
be29171106 documentation: Fix missing hosts DNS server 2025-05-24 08:22:33 +08:00
anytls
c66b32c859 Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-05-24 08:22:33 +08:00
ReleTor
984ebbb288 documentation: Minor fixes 2025-05-24 08:22:33 +08:00
libtry486
c5929cf948 documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-05-24 08:22:32 +08:00
Alireza Ahmadi
be45dd2716 Fix Outbound deadlock 2025-05-24 08:22:32 +08:00
世界
a20f525048 documentation: Fix AnyTLS doc 2025-05-24 08:22:31 +08:00
anytls
31ebe2f39f Add AnyTLS protocol 2025-05-24 08:22:31 +08:00
世界
61b9da2f1a Migrate to stdlib ECH support 2025-05-24 08:22:30 +08:00
世界
f5c738ea9d Add fallback local DNS server for iOS 2025-05-24 08:22:29 +08:00
世界
ebc783b580 Get darwin local DNS server from libresolv 2025-05-24 08:22:29 +08:00
世界
a5b6dff812 Improve resolve action 2025-05-24 08:22:29 +08:00
世界
cc4e90c861 Add back port hopping to hysteria 1 2025-05-24 08:22:28 +08:00
xchacha20-poly1305
2abce0959a Remove single quotes of raw Moziila certs 2025-05-24 08:22:28 +08:00
世界
a98cb0fd84 Add Tailscale endpoint 2025-05-24 08:22:27 +08:00
世界
7b96406592 Build legacy binaries with latest Go 2025-05-24 08:22:27 +08:00
世界
4fea063b6f documentation: Remove outdated icons 2025-05-24 08:22:27 +08:00
世界
1672d5a84a documentation: Certificate store 2025-05-24 08:22:26 +08:00
世界
4a1b69c1d4 documentation: TLS fragment 2025-05-24 08:22:25 +08:00
世界
e2c1ff3a11 documentation: Outbound domain resolver 2025-05-24 08:22:25 +08:00
世界
37dd8fa692 documentation: Refactor DNS 2025-05-24 08:22:25 +08:00
世界
29b6a75f16 Add certificate store 2025-05-24 08:22:25 +08:00
世界
7575746f72 Add TLS fragment support 2025-05-24 08:22:03 +08:00
世界
f35a58b7ee refactor: Outbound domain resolver 2025-05-24 08:22:02 +08:00
世界
4aacdade73 refactor: DNS 2025-05-24 08:21:59 +08:00
世界
bc5eb1e1a5 Fix RoutePacketConnectionEx 2025-05-24 08:14:43 +08:00
世界
995267a042 Remove wrong ALPNs in DOH/DOH3 2025-05-24 08:00:13 +08:00
世界
41226a6075 Fix interface finder 2025-05-23 10:57:38 +08:00
世界
81d32181ce Fix update route address set 2025-05-20 19:46:54 +08:00
11 changed files with 35 additions and 22 deletions

View File

@@ -1,11 +1,10 @@
NAME = sing-box
COMMIT = $(shell git rev-parse --short HEAD)
TAGS ?= with_gvisor,with_dhcp,with_wireguard,with_clash_api,with_quic,with_utls,with_tailscale
TAGS_TEST ?= with_gvisor,with_quic,with_wireguard,with_grpc,with_utls
TAGS ?= with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale
GOHOSTOS = $(shell go env GOHOSTOS)
GOHOSTARCH = $(shell go env GOHOSTARCH)
VERSION=$(shell CGO_ENABLED=0 GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go run ./cmd/internal/read_tag)
VERSION=$(shell CGO_ENABLED=0 GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go run github.com/sagernet/sing-box/cmd/internal/read_tag@latest)
PARAMS = -v -trimpath -ldflags "-X 'github.com/sagernet/sing-box/constant.Version=$(VERSION)' -s -w -buildid="
MAIN_PARAMS = $(PARAMS) -tags "$(TAGS)"

View File

@@ -7,7 +7,6 @@ import (
"strconv"
"time"
"github.com/sagernet/sing-box"
"github.com/sagernet/sing-box/experimental/deprecated"
"github.com/sagernet/sing-box/include"
"github.com/sagernet/sing-box/log"
@@ -68,6 +67,5 @@ func preRun(cmd *cobra.Command, args []string) {
if len(configPaths) == 0 && len(configDirectories) == 0 {
configPaths = append(configPaths, "config.json")
}
globalCtx = service.ContextWith(globalCtx, deprecated.NewStderrManager(log.StdLogger()))
globalCtx = box.Context(globalCtx, include.InboundRegistry(), include.OutboundRegistry(), include.EndpointRegistry(), include.DNSTransportRegistry(), include.ServiceRegistry())
globalCtx = include.Context(service.ContextWith(globalCtx, deprecated.NewStderrManager(log.StdLogger())))
}

View File

@@ -2,10 +2,15 @@
icon: material/alert-decagram
---
#### 1.12.0-beta.16
#### 1.12.0-beta.18
* Fixes and improvements
#### 1.12.0-beta.17
* Update quic-go to v0.52.0
* Fixes and improvements
#### 1.12.0-beta.15
* Add DERP service **1**

8
go.mod
View File

@@ -10,6 +10,7 @@ require (
github.com/cretz/bine v0.2.0
github.com/go-chi/chi/v5 v5.2.1
github.com/go-chi/render v1.0.3
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466
github.com/gofrs/uuid/v5 v5.3.2
github.com/insomniacslk/dhcp v0.0.0-20250417080101-5f8cf70e8c5f
github.com/libdns/alidns v1.0.4-libdns.v1.beta1
@@ -26,10 +27,10 @@ require (
github.com/sagernet/fswatch v0.1.1
github.com/sagernet/gomobile v0.1.6
github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb
github.com/sagernet/quic-go v0.51.0-beta.5
github.com/sagernet/sing v0.6.10-0.20250520081401-f94e3eea09f2
github.com/sagernet/quic-go v0.52.0-beta.1
github.com/sagernet/sing v0.6.11-0.20250521033217-30d675ea099b
github.com/sagernet/sing-mux v0.3.2
github.com/sagernet/sing-quic v0.4.1-0.20250511050139-d459f561c9c3
github.com/sagernet/sing-quic v0.5.0-beta.1
github.com/sagernet/sing-shadowsocks v0.2.7
github.com/sagernet/sing-shadowsocks2 v0.2.0
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11
@@ -78,7 +79,6 @@ require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect

12
go.sum
View File

@@ -165,15 +165,15 @@ github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a h1:ObwtHN2VpqE0ZN
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
github.com/sagernet/nftables v0.3.0-beta.4 h1:kbULlAwAC3jvdGAC1P5Fa3GSxVwQJibNenDW2zaXr8I=
github.com/sagernet/nftables v0.3.0-beta.4/go.mod h1:OQXAjvjNGGFxaTgVCSTRIhYB5/llyVDeapVoENYBDS8=
github.com/sagernet/quic-go v0.51.0-beta.5 h1:/mME3sJvQ8k/JKP0oC/9XoWrm0znO7hWXviB5yiipJY=
github.com/sagernet/quic-go v0.51.0-beta.5/go.mod h1:OV+V5kEBb8kJS7k29MzDu6oj9GyMc7HA07sE1tedxz4=
github.com/sagernet/quic-go v0.52.0-beta.1 h1:hWkojLg64zjV+MJOvJU/kOeWndm3tiEfBLx5foisszs=
github.com/sagernet/quic-go v0.52.0-beta.1/go.mod h1:OV+V5kEBb8kJS7k29MzDu6oj9GyMc7HA07sE1tedxz4=
github.com/sagernet/sing v0.6.9/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing v0.6.10-0.20250520081401-f94e3eea09f2 h1:RrfNtYL92W+NSiREd2BniJE+b4PjG9bf+TRzr0uDlYg=
github.com/sagernet/sing v0.6.10-0.20250520081401-f94e3eea09f2/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing v0.6.11-0.20250521033217-30d675ea099b h1:ZjTCYPb5f7aHdf1UpUvE22dVmf7BL8eQ/zLZhjgh7Wo=
github.com/sagernet/sing v0.6.11-0.20250521033217-30d675ea099b/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing-mux v0.3.2 h1:meZVFiiStvHThb/trcpAkCrmtJOuItG5Dzl1RRP5/NE=
github.com/sagernet/sing-mux v0.3.2/go.mod h1:pht8iFY4c9Xltj7rhVd208npkNaeCxzyXCgulDPLUDA=
github.com/sagernet/sing-quic v0.4.1-0.20250511050139-d459f561c9c3 h1:1J+s1yyZ8+YAYaClI+az8YuFgV9NGXUUCZnriKmos6w=
github.com/sagernet/sing-quic v0.4.1-0.20250511050139-d459f561c9c3/go.mod h1:Mv7CdSyLepmqoLT8rd88Qn3QMv5AbsgjEm3DvEhDVNE=
github.com/sagernet/sing-quic v0.5.0-beta.1 h1:nC0i/s8LhlZB8ev6laZCXF/uiwAE4kRdT4PcDdE4rI4=
github.com/sagernet/sing-quic v0.5.0-beta.1/go.mod h1:SAv/qdeDN+75msGG5U5ZIwG+3Ua50jVIKNrRSY8pkx0=
github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8=
github.com/sagernet/sing-shadowsocks v0.2.7/go.mod h1:0rIKJZBR65Qi0zwdKezt4s57y/Tl1ofkaq6NlkzVuyE=
github.com/sagernet/sing-shadowsocks2 v0.2.0 h1:wpZNs6wKnR7mh1wV9OHwOyUr21VkS3wKFHi+8XwgADg=

View File

@@ -3,6 +3,7 @@ package include
import (
"context"
"github.com/sagernet/sing-box"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/adapter/endpoint"
"github.com/sagernet/sing-box/adapter/inbound"
@@ -39,6 +40,10 @@ import (
E "github.com/sagernet/sing/common/exceptions"
)
func Context(ctx context.Context) context.Context {
return box.Context(ctx, InboundRegistry(), OutboundRegistry(), EndpointRegistry(), DNSTransportRegistry(), ServiceRegistry())
}
func InboundRegistry() *inbound.Registry {
registry := inbound.NewRegistry()

View File

@@ -221,6 +221,14 @@ func (t *Endpoint) Start(stage adapter.StartStage) error {
}
ipStack := t.server.ExportNetstack().ExportIPStack()
gErr := ipStack.SetSpoofing(tun.DefaultNIC, true)
if gErr != nil {
return gonet.TranslateNetstackError(gErr)
}
gErr = ipStack.SetPromiscuousMode(tun.DefaultNIC, true)
if gErr != nil {
return gonet.TranslateNetstackError(gErr)
}
ipStack.SetTransportProtocolHandler(tcp.ProtocolNumber, tun.NewTCPForwarder(t.ctx, ipStack, t).HandlePacket)
udpForwarder := tun.NewUDPForwarder(t.ctx, ipStack, t, t.udpTimeout)
ipStack.SetTransportProtocolHandler(udp.ProtocolNumber, udpForwarder.HandlePacket)

View File

@@ -172,8 +172,6 @@ func (r *Router) RoutePacketConnectionEx(ctx context.Context, conn N.PacketConn,
} else {
r.logger.ErrorContext(ctx, err)
}
} else if onClose != nil {
onClose(nil)
}
}

View File

@@ -58,7 +58,7 @@ func NewService(ctx context.Context, logger log.ContextLogger, tag string, optio
for i, entry := range options.Servers.Entries() {
inbound, loaded := inboundManager.Get(entry.Value)
if !loaded {
return nil, E.New("parse SSM server[", i, "]: inbound ", entry.Value, "not found")
return nil, E.New("parse SSM server[", i, "]: inbound ", entry.Value, " not found")
}
managedServer, isManaged := inbound.(adapter.ManagedSSMServer)
if !isManaged {

View File

@@ -55,7 +55,7 @@ func (m *UserManager) Add(username string, password string) error {
m.access.Lock()
defer m.access.Unlock()
if _, found := m.usersMap[username]; found {
return E.New("user", username, "already exists")
return E.New("user ", username, " already exists")
}
m.usersMap[username] = password
return m.postUpdate()

View File

@@ -32,7 +32,7 @@ func TestMain(m *testing.M) {
var globalCtx context.Context
func init() {
globalCtx = box.Context(context.Background(), include.InboundRegistry(), include.OutboundRegistry(), include.EndpointRegistry(), include.DNSTransportRegistry(), include.ServiceRegistry())
globalCtx = include.Context(context.Background())
}
func startInstance(t *testing.T, options option.Options) *box.Box {