1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-09 12:40:35 +08:00

TUN-3449: Use flag to select transport protocol implementation

This commit is contained in:
cthuang
2020-10-08 10:48:10 +01:00
parent 59051ba425
commit d7498b0c03
4 changed files with 41 additions and 4 deletions

View File

@@ -30,6 +30,7 @@ import (
const (
credFileFlagAlias = "cred-file"
availableProtocol = "Available protocols: http2, Go's implementation and h2mux, Cloudflare's implementation of HTTP/2."
)
var (
@@ -83,6 +84,13 @@ var (
Aliases: []string{"f"},
Usage: "Allows you to delete a tunnel, even if it has active connections.",
}
selectProtocolFlag = &cli.StringFlag{
Name: "protocol",
Value: "h2mux",
Aliases: []string{"p"},
Usage: fmt.Sprintf("Protocol implementation to connect with Cloudflare's edge network. %s", availableProtocol),
Hidden: true,
}
)
func buildCreateCommand() *cli.Command {
@@ -309,6 +317,7 @@ func buildRunCommand() *cli.Command {
flags := []cli.Flag{
forceFlag,
credentialsFileFlag,
selectProtocolFlag,
}
flags = append(flags, configureProxyFlags(false)...)
return &cli.Command{