Compare commits

..

33 Commits

Author SHA1 Message Date
世界
fe4e9262de documentation: Bump version 2025-02-24 16:14:29 +08:00
anytls
f45e75a211 Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-02-24 16:14:29 +08:00
ReleTor
048e72af71 documentation: Minor fixes 2025-02-24 07:28:52 +08:00
libtry486
8dd9197687 documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-02-24 07:28:33 +08:00
Alireza Ahmadi
8fe78e4f88 Fix Outbound deadlock 2025-02-24 07:28:32 +08:00
世界
8d61c9b69d documentation: Fix AnyTLS doc 2025-02-24 07:28:32 +08:00
anytls
7d028a9b29 Add AnyTLS protocol 2025-02-24 07:28:32 +08:00
世界
84c14614b7 Migrate to stdlib ECH support 2025-02-24 07:28:32 +08:00
世界
462807a43b Add fallback local DNS server for iOS 2025-02-24 07:28:32 +08:00
世界
cb390ccd45 Get darwin local DNS server from libresolv 2025-02-24 07:28:32 +08:00
世界
b2073bc39a Improve resolve action 2025-02-24 07:28:32 +08:00
世界
0e48fc4498 Fix toolchain version 2025-02-24 07:28:29 +08:00
世界
0c85f49c3b Add back port hopping to hysteria 1 2025-02-24 07:28:29 +08:00
世界
fd5e5d13dc Update dependencies 2025-02-24 07:28:29 +08:00
xchacha20-poly1305
70107973ae Remove single quotes of raw Moziila certs 2025-02-24 07:28:28 +08:00
世界
6ceaee4188 Add Tailscale endpoint 2025-02-24 07:28:20 +08:00
世界
a034f82f6a Build legacy binaries with latest Go 2025-02-24 07:28:20 +08:00
世界
92e20421f0 documentation: Remove outdated icons 2025-02-24 07:28:20 +08:00
世界
7b44e98fc8 documentation: Certificate store 2025-02-24 07:28:20 +08:00
世界
4cf68c4aa9 documentation: TLS fragment 2025-02-24 07:28:19 +08:00
世界
8e2ed8d0f3 documentation: Outbound domain resolver 2025-02-24 07:28:19 +08:00
世界
05f3df59b0 documentation: Refactor DNS 2025-02-24 07:28:19 +08:00
世界
128325b128 Add certificate store 2025-02-24 07:28:19 +08:00
世界
a18c7d6eb9 Add TLS fragment support 2025-02-24 07:28:19 +08:00
世界
42fe00ed30 refactor: Outbound domain resolver 2025-02-24 07:28:19 +08:00
世界
777066572f refactor: DNS 2025-02-24 07:28:18 +08:00
世界
eb07c7a79e Bump version 2025-02-24 07:27:55 +08:00
Gavin Luo
7eb3535094 release: Fix systemd permissions 2025-02-24 07:27:55 +08:00
世界
93b68312cf platform: Add update WIFI state func 2025-02-23 08:35:30 +08:00
世界
97ce666e43 Fix http.FileServer short write 2025-02-23 08:35:30 +08:00
世界
4000e1e66d release: Fix update android version 2025-02-23 08:35:30 +08:00
世界
270740e859 Fix crash on route address set update 2025-02-23 08:35:30 +08:00
世界
6cad142cfe Bump Go to go1.24 2025-02-23 08:35:30 +08:00
13 changed files with 35 additions and 14 deletions

View File

@@ -246,8 +246,6 @@ func (m *Manager) Create(ctx context.Context, router adapter.Router, logger log.
if err != nil {
return err
}
m.access.Lock()
defer m.access.Unlock()
if m.started {
for _, stage := range adapter.ListStartStages {
err = adapter.LegacyStart(outbound, stage)
@@ -256,6 +254,8 @@ func (m *Manager) Create(ctx context.Context, router adapter.Router, logger log.
}
}
}
m.access.Lock()
defer m.access.Unlock()
if existsOutbound, loaded := m.outboundByTag[tag]; loaded {
if m.started {
err = common.Close(existsOutbound)

View File

@@ -34,10 +34,13 @@ func NewStore(ctx context.Context, logger logger.Logger, options option.Certific
switch options.Store {
case C.CertificateStoreSystem, "":
systemPool = x509.NewCertPool()
platformInterface := service.FromContext[platform.Interface](ctx)
var systemValid bool
for _, cert := range service.FromContext[platform.Interface](ctx).SystemCertificates() {
if systemPool.AppendCertsFromPEM([]byte(cert)) {
systemValid = true
if platformInterface != nil {
for _, cert := range platformInterface.SystemCertificates() {
if systemPool.AppendCertsFromPEM([]byte(cert)) {
systemValid = true
}
}
}
if !systemValid {

View File

@@ -2,6 +2,14 @@
icon: material/alert-decagram
---
#### 1.12.0-alpha.12
* Fixes and improvements
### 1.11.4
* Fixes and improvements
#### 1.12.0-alpha.11
* Fixes and improvements

View File

@@ -4,7 +4,7 @@ icon: material/new-box
!!! question "Since sing-box 1.12.0"
# TCP
# UDP
### Structure

View File

@@ -16,6 +16,7 @@ icon: material/new-box
"password": "8JCsPssfgS8tiRwiMlhARg==",
"idle_session_check_interval": "30s",
"idle_session_timeout": "30s",
"min_idle_session": 5,
"tls": {},
... // Dial Fields
@@ -50,6 +51,10 @@ Interval checking for idle sessions. Default: 30s.
In the check, close sessions that have been idle for longer than this. Default: 30s.
#### min_idle_session
In the check, at least the first `n` idle sessions are kept open. Default value: `n`=0
#### tls
==Required==

View File

@@ -16,6 +16,7 @@ icon: material/new-box
"password": "8JCsPssfgS8tiRwiMlhARg==",
"idle_session_check_interval": "30s",
"idle_session_timeout": "30s",
"min_idle_session": 5,
"tls": {},
... // 拨号字段
@@ -50,6 +51,10 @@ AnyTLS 密码。
在检查中关闭闲置时间超过此值的会话。默认值30秒。
#### min_idle_session
在检查中,至少前 `n` 个空闲会话保持打开状态。默认值:`n`=0
#### tls
==必填==

View File

@@ -58,6 +58,6 @@ go build -tags "tag_a tag_b" ./cmd/sing-box
| `with_v2ray_api` | :material-close: | Build with V2Ray API support, see [Experimental](/configuration/experimental#v2ray-api-fields). |
| `with_gvisor` | :material-check: | Build with gVisor support, see [Tun inbound](/configuration/inbound/tun#stack) and [WireGuard outbound](/configuration/outbound/wireguard#system_interface). |
| `with_embedded_tor` (CGO required) | :material-close: | Build with embedded Tor support, see [Tor outbound](/configuration/outbound/tor/). |
| `with_tailscale` | :material-check: | Build with Tailscale support, see [Tailscale endpoint](/configuration/endpoint/tailscale) |
| `with_tailscale` | :material-check: | Build with Tailscale support, see [Tailscale endpoint](/configuration/endpoint/tailscale) |
It is not recommended to change the default build tag list unless you really know what you are adding.

2
go.mod
View File

@@ -3,7 +3,7 @@ module github.com/sagernet/sing-box
go 1.23.1
require (
github.com/anytls/sing-anytls v0.0.2
github.com/anytls/sing-anytls v0.0.3
github.com/caddyserver/certmagic v0.21.7
github.com/cloudflare/circl v1.6.0
github.com/cretz/bine v0.2.0

6
go.sum
View File

@@ -8,10 +8,8 @@ github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7V
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/anytls/sing-anytls v0.0.1 h1:Hex6GFUcgATWMWL2E9YgH/7oPgwdokiIF09UQi5BEC0=
github.com/anytls/sing-anytls v0.0.1/go.mod h1:7rjN6IukwysmdusYsrV51Fgu1uW6vsrdd6ctjnEAln8=
github.com/anytls/sing-anytls v0.0.2 h1:25azSh0o/LMcIkhS4ZutgRTIGwh8O3wuOhsThVM9K9o=
github.com/anytls/sing-anytls v0.0.2/go.mod h1:7rjN6IukwysmdusYsrV51Fgu1uW6vsrdd6ctjnEAln8=
github.com/anytls/sing-anytls v0.0.3 h1:JAQpETCUiZ1LFAPnO8vyJsdxypvKB4zinXwy9KiqWeQ=
github.com/anytls/sing-anytls v0.0.3/go.mod h1:7rjN6IukwysmdusYsrV51Fgu1uW6vsrdd6ctjnEAln8=
github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE=
github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/caddyserver/certmagic v0.21.7 h1:66KJioPFJwttL43KYSWk7ErSmE6LfaJgCQuhm8Sg6fg=

View File

@@ -21,4 +21,5 @@ type AnyTLSOutboundOptions struct {
Password string `json:"password,omitempty"`
IdleSessionCheckInterval badoption.Duration `json:"idle_session_check_interval,omitempty"`
IdleSessionTimeout badoption.Duration `json:"idle_session_timeout,omitempty"`
MinIdleSession int `json:"min_idle_session,omitempty"`
}

View File

@@ -63,6 +63,7 @@ func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextL
Password: options.Password,
IdleSessionCheckInterval: options.IdleSessionCheckInterval.Build(),
IdleSessionTimeout: options.IdleSessionTimeout.Build(),
MinIdleSession: options.MinIdleSession,
DialOut: outbound.dialOut,
Logger: logger,
})