𐲓𐳛𐳪𐳂𐳐 𐲀𐳢𐳦𐳫𐳢 𐲥𐳔𐳛𐳪𐳌𐳑𐳖𐳇
2026-05-29 23:04:59 +08:00
committed by GitHub
parent ca4b156b57
commit d43a808ea5
114 changed files with 736 additions and 378 deletions
-1
View File
@@ -59,7 +59,6 @@ func executeBalancerInfo(cmd *base.Command, args []string) {
}
showBalancerInfo(resp.Balancer)
}
func showBalancerInfo(b *routerService.BalancerMsg) {
+2 -1
View File
@@ -62,7 +62,8 @@ func addInboundUserAction(ctx context.Context, client handlerService.HandlerServ
Operation: cserial.ToTypedMessage(
&handlerService.AddUserOperation{
User: user,
}),
},
),
})
return err
}
+2 -1
View File
@@ -50,7 +50,8 @@ func executeRemoveUsers(cmd *base.Command, args []string) {
Operation: cserial.ToTypedMessage(
&handlerService.RemoveUserOperation{
Email: email,
}),
},
),
})
if err == nil {
success += 1
+1 -4
View File
@@ -38,9 +38,7 @@ Example:
}
func executeAddRules(cmd *base.Command, args []string) {
var (
shouldAppend bool
)
var shouldAppend bool
setSharedFlags(cmd)
cmd.Flag.BoolVar(&shouldAppend, "append", false, "")
cmd.Flag.Parse(args)
@@ -96,5 +94,4 @@ func executeAddRules(cmd *base.Command, args []string) {
}
showJSONResponse(resp)
}
}
-1
View File
@@ -56,5 +56,4 @@ func executeRemoveRules(cmd *base.Command, args []string) {
}
showJSONResponse(resp)
}
}
-1
View File
@@ -136,5 +136,4 @@ func executeSourceIpBlock(cmd *base.Command, args []string) {
base.Fatalf("failed to perform AddRule: %s", err)
}
showJSONResponse(resp)
}
-1
View File
@@ -38,7 +38,6 @@ Examples:
}
func executeTypedMessageToJson(cmd *base.Command, args []string) {
var injectTypeInfo bool
cmd.Flag.BoolVar(&injectTypeInfo, "t", false, "")
cmd.Flag.BoolVar(&injectTypeInfo, "type", false, "")
+1 -2
View File
@@ -41,7 +41,6 @@ Examples:
}
func executeConvertConfigsToProtobuf(cmd *base.Command, args []string) {
var optFile string
var optDump bool
var optType bool
@@ -60,7 +59,7 @@ func executeConvertConfigsToProtobuf(cmd *base.Command, args []string) {
}
if len(optFile) > 0 {
switch core.GetFormat(optFile){
switch core.GetFormat(optFile) {
case "protobuf", "":
fmt.Println("Output ProtoBuf file is ", optFile)
default:
+4 -2
View File
@@ -34,8 +34,10 @@ func init() {
var input_echServerKeys = cmdECH.Flag.String("i", "", "ECHServerKeys (base64.StdEncoding)")
// var input_pqSignatureSchemesEnabled = cmdECH.Flag.Bool("pqSignatureSchemesEnabled", false, "")
var input_serverName = cmdECH.Flag.String("serverName", "cloudflare-ech.com", "")
var input_pem = cmdECH.Flag.Bool("pem", false, "True == turn on pem output")
var (
input_serverName = cmdECH.Flag.String("serverName", "cloudflare-ech.com", "")
input_pem = cmdECH.Flag.Bool("pem", false, "True == turn on pem output")
)
func executeECH(cmd *base.Command, args []string) {
var kem uint16
+4 -2
View File
@@ -21,8 +21,10 @@ func init() {
cmdX25519.Run = executeX25519 // break init loop
}
var input_stdEncoding = cmdX25519.Flag.Bool("std-encoding", false, "")
var input_x25519 = cmdX25519.Flag.String("i", "", "")
var (
input_stdEncoding = cmdX25519.Flag.Bool("std-encoding", false, "")
input_x25519 = cmdX25519.Flag.String("i", "", "")
)
func executeX25519(cmd *base.Command, args []string) {
Curve25519Genkey(false, *input_x25519)
+1 -3
View File
@@ -12,9 +12,7 @@ type (
configFileLoader func(string) (io.Reader, error)
)
var (
EffectiveConfigFileLoader configFileLoader
)
var EffectiveConfigFileLoader configFileLoader
// LoadConfig reads from a path/url/stdin
// actual work is in external module
+10 -12
View File
@@ -52,7 +52,7 @@ func ConfigLoader(arg string) (out io.Reader, err error) {
// When the ":/" separator is omitted on a socket target, the request is
// made to "/".
func FetchHTTPContent(target string) ([]byte, error) {
httpURL, socketPath := utils.SplitHTTPUnixURL(target)
httpURL, socketPath := utils.SplitHTTPUnixURL(target)
parsedTarget, err := url.Parse(httpURL)
if err != nil {
@@ -63,15 +63,15 @@ func FetchHTTPContent(target string) ([]byte, error) {
Timeout: 30 * time.Second,
}
if socketPath != "" {
dialAddr := utils.ResolveSocketPath(socketPath)
client.Transport = &http.Transport{
DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) {
var d net.Dialer
return d.DialContext(ctx, "unix", dialAddr)
},
}
}
if socketPath != "" {
dialAddr := utils.ResolveSocketPath(socketPath)
client.Transport = &http.Transport{
DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) {
var d net.Dialer
return d.DialContext(ctx, "unix", dialAddr)
},
}
}
resp, err := client.Do(&http.Request{
Method: "GET",
@@ -95,7 +95,6 @@ func FetchHTTPContent(target string) ([]byte, error) {
return content, nil
}
// isRemoteSource reports whether arg should be fetched via HTTP (regular
// network or Unix socket) rather than read from the local filesystem.
// Recognized forms:
@@ -124,7 +123,6 @@ func isRemoteSource(arg string) bool {
return err == nil && info.Mode()&os.ModeSocket != 0
}
// httpUnixToCanonical converts the deprecated http+unix:///path/to/socket.sock/api
// URL into the canonical /path/to/socket.sock:/api form by inserting ":"
// between the ".sock" extension and the HTTP path. Inputs without a path