mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-07-31 19:14:17 +03:00
Compare commits
15 Commits
v1.13.11-e
...
v1.13.11-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8670a742a | ||
|
|
e2ef7d83a1 | ||
|
|
af75b8074f | ||
|
|
2e0306ae41 | ||
|
|
ee2945ac8f | ||
|
|
b2503ca860 | ||
|
|
dcb1da8683 | ||
|
|
22aeb48794 | ||
|
|
019103587b | ||
|
|
3139f18bf1 | ||
|
|
493538c743 | ||
|
|
578bc159fb | ||
|
|
f0c317cb0b | ||
|
|
32bc1a9fce | ||
|
|
41922ba731 |
62
README.md
62
README.md
@@ -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>
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -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": [
|
||||||
@@ -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
3
go.mod
@@ -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
|
||||||
|
|||||||
@@ -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 != "" {
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user