Compare commits

..

15 Commits

Author SHA1 Message Date
Sergei Maklagin
d8670a742a Merge branch 'extended' of https://github.com/shtorm-7/sing-box-extended into extended 2026-05-02 15:00:57 +03:00
Sergei Maklagin
e2ef7d83a1 Fix creating config for WARP 2026-05-02 14:54:26 +03:00
Shtorm
af75b8074f Update README.md
Signed-off-by: Shtorm <108103062+shtorm-7@users.noreply.github.com>
2026-04-30 23:39:22 +03:00
Sergei Maklagin
2e0306ae41 Disable Wireguard ICMP 2026-04-30 19:20:23 +03:00
Sergei Maklagin
ee2945ac8f Fix OverrideGateway 2026-04-30 19:19:40 +03:00
Sergei Maklagin
b2503ca860 Update chi 2026-04-30 19:18:50 +03:00
Sergei Maklagin
dcb1da8683 Fix examples 2026-04-30 13:20:45 +03:00
Sergei Maklagin
22aeb48794 Merge branch 'extended' of https://github.com/shtorm-7/sing-box-extended into extended 2026-04-30 13:14:37 +03:00
Sergei Maklagin
019103587b Update examples 2026-04-30 13:14:17 +03:00
Sergei Maklagin
3139f18bf1 Update android build tags 2026-04-30 12:17:37 +03:00
Shtorm
493538c743 Update README.md
Signed-off-by: Shtorm <108103062+shtorm-7@users.noreply.github.com>
2026-04-30 11:15:15 +03:00
Shtorm
578bc159fb Update README.md
Signed-off-by: Shtorm <108103062+shtorm-7@users.noreply.github.com>
2026-04-30 01:15:21 +03:00
Shtorm
f0c317cb0b Update README.md
Signed-off-by: Shtorm <108103062+shtorm-7@users.noreply.github.com>
2026-04-30 01:12:28 +03:00
Shtorm
32bc1a9fce Update README.md
Signed-off-by: Shtorm <108103062+shtorm-7@users.noreply.github.com>
2026-04-30 01:08:36 +03:00
Sergei Maklagin
41922ba731 Update README.md 2026-04-29 22:40:15 +03:00
11 changed files with 80 additions and 67 deletions

View File

@@ -4,37 +4,37 @@ Sing-box with extended features.
## 🔥 Features ## 🔥 Features
### 🌐 Protocols ### Protocols
- **WARP** - WARP
- **Masque** - MASQUE
- **MTProxy** - MTProxy
- **Mieru** - Mieru
- **VPN** - VPN
- **Bond** - Bond
- **Fallback** - Fallback
### 🚦 Limiters ### Limiters
- **Bandwidth Limiter** - Bandwidth Limiter
- **Connection Limiter** - Connection Limiter
### 🛡 Encryption & Obfuscation ### Encryption & Obfuscation
- **Amnezia 2.0** - Amnezia 2.0
- **VLESS encryption** - VLESS encryption
### 🔄 Transports ### Transports
- **mKCP** - mKCP
- **XHTTP** - XHTTP
### 🛠 Services ### Services
- **Admin Panel** - Admin Panel
- **Manager** - Manager
- **Node Manager** - Node Manager
### Miscellaneous ### Miscellaneous
- **Link parser** - Link parser
- **SDNS (DNSCrypt)** - SDNS (DNSCrypt)
- **Extended WireGuard options** - Extended WireGuard options
- **Unified Delay** - Unified Delay
## 📚 Examples ## 📚 Examples
@@ -46,6 +46,14 @@ https://github.com/shtorm-7/sing-box-extended/tree/extended/examples
If you want to support the project, you can donate to the following addresses. If you want to support the project, you can donate to the following addresses.
#### Tribute
**[RUB Donate](https://web.tribute.tg/d/JxY)**
**[EUR Donate](https://web.tribute.tg/d/JxZ)**
**[USD Donate](https://web.tribute.tg/d/Jy1)**
#### TRX (Tron) #### TRX (Tron)
``` ```
TSWU6VUZ4FcUghYDmbbhK15gRVvhvBgW3F TSWU6VUZ4FcUghYDmbbhK15gRVvhvBgW3F
@@ -67,7 +75,7 @@ bc1qqx97p8k4dchqkyd47s4vf74hrqdfnmhqvcja7x
0xAcc5919C22F2B3fAa0ec7E8BaD142da5B375FBF6 0xAcc5919C22F2B3fAa0ec7E8BaD142da5B375FBF6
``` ```
## 📄 License ## License
``` ```
Copyright (C) 2022 by nekohasekai <contact-sagernet@sekai.icu> Copyright (C) 2022 by nekohasekai <contact-sagernet@sekai.icu>

View File

@@ -63,7 +63,7 @@ func init() {
sharedFlags = append(sharedFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag+" -X internal/godebug.defaultGODEBUG=multipathtcp=0 -s -w -buildid= -checklinkname=0") sharedFlags = append(sharedFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag+" -X internal/godebug.defaultGODEBUG=multipathtcp=0 -s -w -buildid= -checklinkname=0")
debugFlags = append(debugFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag+" -X internal/godebug.defaultGODEBUG=multipathtcp=0 -checklinkname=0") debugFlags = append(debugFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag+" -X internal/godebug.defaultGODEBUG=multipathtcp=0 -checklinkname=0")
sharedTags = append(sharedTags, "with_gvisor", "with_quic", "with_wireguard", "with_utls", "with_naive_outbound", "with_clash_api", "badlinkname", "tfogo_checklinkname0") sharedTags = append(sharedTags, "with_gvisor", "with_quic", "with_wireguard", "with_masque", "with_mtproxy", "with_utls", "with_naive_outbound", "with_clash_api", "badlinkname", "tfogo_checklinkname0")
darwinTags = append(darwinTags, "with_dhcp", "grpcnotrace") darwinTags = append(darwinTags, "with_dhcp", "grpcnotrace")
// memcTags = append(memcTags, "with_tailscale") // memcTags = append(memcTags, "with_tailscale")
sharedTags = append(sharedTags, "with_tailscale", "ts_omit_logtail", "ts_omit_ssh", "ts_omit_drive", "ts_omit_taildrop", "ts_omit_webclient", "ts_omit_doctor", "ts_omit_capture", "ts_omit_kube", "ts_omit_aws", "ts_omit_synology", "ts_omit_bird") sharedTags = append(sharedTags, "with_tailscale", "ts_omit_logtail", "ts_omit_ssh", "ts_omit_drive", "ts_omit_taildrop", "ts_omit_webclient", "ts_omit_doctor", "ts_omit_capture", "ts_omit_kube", "ts_omit_aws", "ts_omit_synology", "ts_omit_bird")

View File

@@ -21,18 +21,20 @@
"key": "1c9b2ccf-b0c0-4c26-868d-a55a4edad3fe" "key": "1c9b2ccf-b0c0-4c26-868d-a55a4edad3fe"
} }
], ],
"inbound": { "inbounds": [
"type": "vless", {
"tag": "vless-in", "type": "vless",
"listen": "0.0.0.0", "tag": "vless-in",
"listen_port": 8000, "listen": "0.0.0.0",
"users": [ "listen_port": 8000,
{ "users": [
"name": "vless", {
"uuid": "9b65b7e1-04c8-4717-8f45-2aa61fd25937" "name": "vless",
} "uuid": "9b65b7e1-04c8-4717-8f45-2aa61fd25937"
] }
} ]
}
]
} }
], ],
"outbounds": [ "outbounds": [

View File

@@ -21,18 +21,20 @@
"key": "1c9b2ccf-b0c0-4c26-868d-a55a4edad3fe" "key": "1c9b2ccf-b0c0-4c26-868d-a55a4edad3fe"
} }
], ],
"inbound": { "inbounds": [
"type": "vless", {
"tag": "vless-in", "type": "vless",
"listen": "0.0.0.0", "tag": "vless-in",
"listen_port": 8000, "listen": "0.0.0.0",
"users": [ "listen_port": 8000,
{ "users": [
"name": "vless", {
"uuid": "9b65b7e1-04c8-4717-8f45-2aa61fd25937" "name": "vless",
} "uuid": "9b65b7e1-04c8-4717-8f45-2aa61fd25937"
] }
} ]
}
]
} }
], ],
"inbounds": [ "inbounds": [

3
go.mod
View File

@@ -13,7 +13,6 @@ require (
github.com/cretz/bine v0.2.0 github.com/cretz/bine v0.2.0
github.com/database64128/tfo-go/v2 v2.3.2 github.com/database64128/tfo-go/v2 v2.3.2
github.com/enfein/mieru/v3 v3.17.1 github.com/enfein/mieru/v3 v3.17.1
github.com/go-chi/chi v1.5.5
github.com/go-chi/chi/v5 v5.2.5 github.com/go-chi/chi/v5 v5.2.5
github.com/go-chi/render v1.0.3 github.com/go-chi/render v1.0.3
github.com/go-playground/validator/v10 v10.30.1 github.com/go-playground/validator/v10 v10.30.1
@@ -240,3 +239,5 @@ replace github.com/patrickmn/go-cache/v2 => github.com/shtorm-7/go-cache/v2 v2.1
replace github.com/dolonet/mtg-multi => github.com/shtorm-7/mtg-multi v1.8.0-extended-1.0.0 replace github.com/dolonet/mtg-multi => github.com/shtorm-7/mtg-multi v1.8.0-extended-1.0.0
replace github.com/Diniboy1123/connect-ip-go => github.com/shtorm-7/connect-ip-go v1.0.0-extended-1.0.0 replace github.com/Diniboy1123/connect-ip-go => github.com/shtorm-7/connect-ip-go v1.0.0-extended-1.0.0
replace github.com/GoAdminGroup/go-admin => github.com/shtorm-7/go-admin v1.2.26-extended-1.0.0

View File

@@ -68,7 +68,7 @@ func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextL
} }
} }
if config == nil { if config == nil {
config, err := endpoint.createConfig() config, err = endpoint.createConfig()
if err != nil { if err != nil {
logger.ErrorContext(ctx, err) logger.ErrorContext(ctx, err)
return return
@@ -183,6 +183,16 @@ func (w *Endpoint) isEndpointInitialized(ctx context.Context) error {
} }
func (w *Endpoint) createConfig() (*Config, error) { func (w *Endpoint) createConfig() (*Config, error) {
opts := make([]cloudflare.CloudflareApiOption, 0, 1)
if w.options.Profile.Detour != "" {
detour, ok := service.FromContext[adapter.OutboundManager](w.ctx).Outbound(w.options.Profile.Detour)
if !ok {
return nil, E.New("outbound detour not found: ", w.options.Profile.Detour)
}
opts = append(opts, cloudflare.WithDialContext(func(ctx context.Context, network, addr string) (net.Conn, error) {
return detour.DialContext(ctx, network, M.ParseSocksaddr(addr))
}))
}
var privateKey wgtypes.Key var privateKey wgtypes.Key
var err error var err error
if w.options.Profile.PrivateKey != "" { if w.options.Profile.PrivateKey != "" {
@@ -196,16 +206,6 @@ func (w *Endpoint) createConfig() (*Config, error) {
return nil, err return nil, err
} }
} }
opts := make([]cloudflare.CloudflareApiOption, 0, 1)
if w.options.Profile.Detour != "" {
detour, ok := service.FromContext[adapter.OutboundManager](w.ctx).Outbound(w.options.Profile.Detour)
if !ok {
return nil, E.New("outbound detour not found: ", w.options.Profile.Detour)
}
opts = append(opts, cloudflare.WithDialContext(func(ctx context.Context, network, addr string) (net.Conn, error) {
return detour.DialContext(ctx, network, M.ParseSocksaddr(addr))
}))
}
api := cloudflare.NewCloudflareApi(opts...) api := cloudflare.NewCloudflareApi(opts...)
var profile *cloudflare.CloudflareProfile var profile *cloudflare.CloudflareProfile
if w.options.Profile.AuthToken != "" && w.options.Profile.ID != "" { if w.options.Profile.AuthToken != "" && w.options.Profile.ID != "" {

View File

@@ -45,7 +45,7 @@ type Endpoint struct {
func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.WireGuardEndpointOptions) (adapter.Endpoint, error) { func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.WireGuardEndpointOptions) (adapter.Endpoint, error) {
ep := &Endpoint{ ep := &Endpoint{
Adapter: endpoint.NewAdapterWithDialerOptions(C.TypeWireGuard, tag, []string{N.NetworkTCP, N.NetworkUDP, N.NetworkICMP}, options.DialerOptions), Adapter: endpoint.NewAdapterWithDialerOptions(C.TypeWireGuard, tag, []string{N.NetworkTCP, N.NetworkUDP}, options.DialerOptions),
ctx: ctx, ctx: ctx,
router: router, router: router,
dnsRouter: service.FromContext[adapter.DNSRouter](ctx), dnsRouter: service.FromContext[adapter.DNSRouter](ctx),

View File

@@ -485,7 +485,7 @@ match:
Fqdn: metadata.Destination.Fqdn, Fqdn: metadata.Destination.Fqdn,
} }
} }
if routeOptions.OverrideGateway.IsValid() { if routeOptions.OverrideGateway != nil && routeOptions.OverrideGateway.IsValid() {
metadata.Gateway = routeOptions.OverrideGateway metadata.Gateway = routeOptions.OverrideGateway
} }
if routeOptions.NetworkStrategy != nil { if routeOptions.NetworkStrategy != nil {

View File

@@ -8,7 +8,7 @@ import (
"errors" "errors"
"net/http" "net/http"
"github.com/go-chi/chi" "github.com/go-chi/chi/v5"
"github.com/golang-migrate/migrate/v4" "github.com/golang-migrate/migrate/v4"
_ "github.com/lib/pq" _ "github.com/lib/pq"
"golang.org/x/net/http2" "golang.org/x/net/http2"