Compare commits

...

6 Commits

Author SHA1 Message Date
neletor
f3707fffbf
Add support for ech retry configs 2025-08-11 22:46:00 +08:00
Zephyruso
245b5d5f42
Add /dns/flush-clash meta api 2025-08-11 22:46:00 +08:00
世界
2358efe44a
release: Fix android build 2025-08-11 22:11:14 +08:00
世界
09d3b8f2c2
release: Fix repo 2025-08-11 22:11:14 +08:00
yu
531de77124
documentation: Fix tun address format 2025-08-11 22:11:13 +08:00
Kismet
44981fd803
documentation: Fix typo 2025-08-11 22:11:13 +08:00
7 changed files with 34 additions and 11 deletions

View File

@ -7,6 +7,11 @@ on:
description: "Version name"
required: true
type: string
forceBeta:
description: "Force beta"
required: false
type: boolean
default: false
release:
types:
- published
@ -99,11 +104,11 @@ jobs:
run: |-
TZ=UTC touch -t '197001010000' dist/sing-box
- name: Set name
if: ${{ ! contains(needs.calculate_version.outputs.version, '-') }}
if: (! contains(needs.calculate_version.outputs.version, '-')) && !inputs.forceBeta
run: |-
echo "NAME=sing-box" >> "$GITHUB_ENV"
- name: Set beta name
if: contains(needs.calculate_version.outputs.version, '-')
if: contains(needs.calculate_version.outputs.version, '-') || inputs.forceBeta
run: |-
echo "NAME=sing-box-beta" >> "$GITHUB_ENV"
- name: Set version

View File

@ -107,13 +107,13 @@ func buildAndroid() {
}
if !debugEnabled {
sharedFlags[3] = sharedFlags[3] + " -checklinkname=0"
args = append(args, sharedFlags...)
} else {
debugFlags[1] = debugFlags[1] + " -checklinkname=0"
args = append(args, debugFlags...)
}
args = append(args, "-ldflags", "-checklinkname=0")
tags := append(sharedTags, memcTags...)
if debugEnabled {
tags = append(tags, debugTags...)

View File

@ -2,6 +2,8 @@ package tls
import (
"context"
"crypto/tls"
"errors"
"net"
"os"
@ -41,6 +43,13 @@ func ClientHandshake(ctx context.Context, conn net.Conn, config Config) (Conn, e
ctx, cancel := context.WithTimeout(ctx, C.TCPTimeout)
defer cancel()
tlsConn, err := aTLS.ClientHandshake(ctx, conn, config)
var echErr *tls.ECHRejectionError
if errors.As(err, &echErr) && len(echErr.RetryConfigList) > 0 {
if echConfig, isECH := config.(ECHCapableConfig); isECH {
echConfig.SetECHConfigList(echErr.RetryConfigList)
tlsConn, err = aTLS.ClientHandshake(ctx, conn, config)
}
}
if err != nil {
return nil, err
}

View File

@ -61,7 +61,7 @@ WireGuard MTU。
==必填==
接口的 IPv4/IPv6 地址或地址段的列表
接口的 IPv4/IPv6 地址或地址段的列表。
要分配给接口的 IPv4 或 v6地址段列表。

View File

@ -88,7 +88,7 @@ icon: material/delete-clock
==必填==
接口的 IPv4/IPv6 地址或地址段的列表
接口的 IPv4/IPv6 地址或地址段的列表。
要分配给接口的 IPv4 或 v6地址段列表。

View File

@ -108,7 +108,7 @@ flowchart TB
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"address": ["172.19.0.1/30"],
"auto_route": true,
// "auto_redirect": true, // On linux
"strict_route": true
@ -162,8 +162,7 @@ flowchart TB
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"address": ["172.19.0.1/30", "fdfe:dcba:9876::1/126"],
"auto_route": true,
// "auto_redirect": true, // On linux
"strict_route": true
@ -233,8 +232,7 @@ flowchart TB
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"address": ["172.19.0.1/30","fdfe:dcba:9876::1/126"],
"auto_route": true,
// "auto_redirect": true, // On linux
"strict_route": true

View File

@ -14,6 +14,7 @@ import (
func cacheRouter(ctx context.Context) http.Handler {
r := chi.NewRouter()
r.Post("/fakeip/flush", flushFakeip(ctx))
r.Post("/dns/flush", flushDNS(ctx))
return r
}
@ -31,3 +32,13 @@ func flushFakeip(ctx context.Context) func(w http.ResponseWriter, r *http.Reques
render.NoContent(w, r)
}
}
func flushDNS(ctx context.Context) func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
dnsRouter := service.FromContext[adapter.DNSRouter](ctx)
if dnsRouter != nil {
dnsRouter.ClearCache()
}
render.NoContent(w, r)
}
}