mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-31 00:14:21 +03:00
Add new admin panel, failover, dns fallback, providers, limiters. Update XHTTP
This commit is contained in:
@@ -2,12 +2,14 @@ package common
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
Xbadoption "github.com/sagernet/sing-box/common/xray/json/badoption"
|
||||
"github.com/sagernet/sing/common/json/badoption"
|
||||
)
|
||||
|
||||
@@ -66,3 +68,12 @@ func DecodeBase64URLSafe(content string) (string, error) {
|
||||
}
|
||||
return string(result), nil
|
||||
}
|
||||
|
||||
func ParseXHTTPRange(value string) (Xbadoption.Range, error) {
|
||||
result := Xbadoption.Range{}
|
||||
encoded, err := json.Marshal(value)
|
||||
if err != nil {
|
||||
return result, err
|
||||
}
|
||||
return result, result.UnmarshalJSON(encoded)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user