MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / buildRunCommand

Function buildRunCommand

cmd/cloudflared/tunnel/subcommands.go:716–749  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

714}
715
716func buildRunCommand() *cli.Command {
717 //nolint: prealloc
718 cliFlags := []cli.Flag{
719 credentialsFileFlag,
720 credentialsContentsFlag,
721 postQuantumFlag,
722 selectProtocolFlag,
723 featuresFlag,
724 tunnelTokenFlag,
725 tunnelTokenFileFlag,
726 icmpv4SrcFlag,
727 icmpv6SrcFlag,
728 maxActiveFlowsFlag,
729 dnsResolverAddrsFlag,
730 }
731 cliFlags = append(cliFlags, configureProxyFlags(false)...)
732 return &cli.Command{
733 Name: "run",
734 Action: cliutil.ConfiguredAction(runCommand),
735 Usage: "Proxy a local web server by running the given tunnel",
736 UsageText: "cloudflared tunnel [tunnel command options] run [subcommand options] [TUNNEL]",
737 Description: `Runs the tunnel identified by name or UUID, creating highly available connections
738 between your server and the Cloudflare edge. You can provide name or UUID of tunnel to run either as the
739 last command line argument or in the configuration file using "tunnel: TUNNEL".
740
741 This command requires the tunnel credentials file created when "cloudflared tunnel create" was run,
742 however it does not need access to cert.pem from "cloudflared login" if you identify the tunnel by UUID.
743 If you experience other problems running the tunnel, "cloudflared tunnel cleanup" may help by removing
744 any old connection records.
745`,
746 Flags: cliFlags,
747 CustomHelpTemplate: commandHelpTemplate(),
748 }
749}
750
751func runCommand(c *cli.Context) error {
752 sc, err := newSubcommandContext(c)

Callers 1

CommandsFunction · 0.85

Calls 3

ConfiguredActionFunction · 0.92
configureProxyFlagsFunction · 0.85
commandHelpTemplateFunction · 0.85

Tested by

no test coverage detected