Compare commits

...

6 Commits

Author SHA1 Message Date
Shtorm
a27453e4f7 Merge pull request #97 from v14d4n/feat/masque-configurable-sni
Make masque TLS SNI configurable via server_name
2026-06-26 14:39:20 +03:00
Shtorm
2a77348470 Update README.md 2026-06-26 04:04:01 +03:00
Shtorm
1ae82a483a Merge branch 'extended' of https://github.com/shtorm-7/sing-box-extended into extended 2026-06-26 03:51:16 +03:00
Shtorm
31acf60eca Fix examples
Signed-off-by: Shtorm <108103062+shtorm-7@users.noreply.github.com>
2026-06-25 15:54:57 +03:00
v14d4n
7bfad732e2 feat(masque): make TLS SNI configurable via server_name
MASQUE outbound previously hardcoded the TLS SNI to consumer-masque.cloudflareclient.com. Add a server_name field to the MASQUE outbound TLS options. When empty it falls back to the existing default (cloudflare.ConnectSNI), so existing configs are unaffected.
2026-06-22 14:12:40 +04:00
Shtorm
2cbc7691f0 Update Telegram badge from channel to chat
Signed-off-by: Shtorm <108103062+shtorm-7@users.noreply.github.com>
2026-06-15 10:43:03 +03:00
5 changed files with 10 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
[![license](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE) [![license](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE)
[![go](https://img.shields.io/badge/go-1.26-00ADD8.svg)](go.mod) [![go](https://img.shields.io/badge/go-1.26-00ADD8.svg)](go.mod)
[![codeberg](https://img.shields.io/badge/mirror-codeberg-2185D0.svg)](https://codeberg.org/shtorm-7/sing-box-extended) [![codeberg](https://img.shields.io/badge/mirror-codeberg-2185D0.svg)](https://codeberg.org/shtorm-7/sing-box-extended)
[![telegram](https://img.shields.io/badge/telegram-channel-26A5E4.svg)](https://t.me/sing_box_extended) [![telegram](https://img.shields.io/badge/telegram-chat-26A5E4.svg)](https://t.me/sing_box_extended)
Sing-box with extended features. Sing-box with extended features.
@@ -17,6 +17,7 @@ Sing-box with extended features.
- **OpenVPN** — OpenVPN client with tls-auth, tls-crypt and tls-crypt-v2 support - **OpenVPN** — OpenVPN client with tls-auth, tls-crypt and tls-crypt-v2 support
- **TrustTunnel** — AdGuard's obfuscated VPN protocol, indistinguishable from HTTPS traffic - **TrustTunnel** — AdGuard's obfuscated VPN protocol, indistinguishable from HTTPS traffic
- **Sudoku** — Traffic obfuscation protocol based on 4×4 Sudoku puzzles with low-entropy fingerprints - **Sudoku** — Traffic obfuscation protocol based on 4×4 Sudoku puzzles with low-entropy fingerprints
- **Snell** — Lightweight encrypted proxy (v1v5) with TLS / HTTP obfuscation
- **SSH** — SSH client and server with certificate authentication and upstream fallback - **SSH** — SSH client and server with certificate authentication and upstream fallback
- **VPN** — Routed tunnel over any TCP sing-box protocol - **VPN** — Routed tunnel over any TCP sing-box protocol
- **Bond** — Link aggregation for increasing throughput - **Bond** — Link aggregation for increasing throughput

View File

@@ -66,7 +66,7 @@
"action": "hijack-dns" "action": "hijack-dns"
} }
], ],
"final": "connection-limiter" "final": "traffic-limiter"
}, },
"services": [ "services": [
{ {

View File

@@ -42,6 +42,7 @@
"congestion_controller": "bbr", "congestion_controller": "bbr",
"cwnd": 0, "cwnd": 0,
"tls": { // TLS fields for HTTP2 "tls": { // TLS fields for HTTP2
"server_name": "", // SNI; empty = default "consumer-masque.cloudflareclient.com"
"insecure": false, "insecure": false,
"cipher_suites": [], "cipher_suites": [],
"curve_preferences": [], "curve_preferences": [],

View File

@@ -24,6 +24,7 @@ type MASQUEOutboundOptions struct {
} }
type MASQUEOutboundTLSOptions struct { type MASQUEOutboundTLSOptions struct {
ServerName string `json:"server_name,omitempty"`
Insecure bool `json:"insecure,omitempty"` Insecure bool `json:"insecure,omitempty"`
CipherSuites badoption.Listable[string] `json:"cipher_suites,omitempty"` CipherSuites badoption.Listable[string] `json:"cipher_suites,omitempty"`
CurvePreferences badoption.Listable[CurvePreference] `json:"curve_preferences,omitempty"` CurvePreferences badoption.Listable[CurvePreference] `json:"curve_preferences,omitempty"`

View File

@@ -102,7 +102,11 @@ func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextL
logger.ErrorContext(ctx, E.New("failed to generate cert: ", err)) logger.ErrorContext(ctx, E.New("failed to generate cert: ", err))
return return
} }
tlsConfig, err := tls.NewMASQUEClient(ctx, logger, "consumer-masque.cloudflareclient.com", cert, privKey, peerPubKey, common.PtrValueOrDefault(options.TLS)) serverName := cloudflare.ConnectSNI
if options.TLS != nil && options.TLS.ServerName != "" {
serverName = options.TLS.ServerName
}
tlsConfig, err := tls.NewMASQUEClient(ctx, logger, serverName, cert, privKey, peerPubKey, common.PtrValueOrDefault(options.TLS))
if err != nil { if err != nil {
logger.ErrorContext(ctx, E.New("failed to prepare TLS config: ", err)) logger.ErrorContext(ctx, E.New("failed to prepare TLS config: ", err))
return return