File
Blob: cmd/client/tunnel.go
| 1 | package client |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | |
| 6 | clientruntime "go.miragespace.co/specter/internal/client" |
| 7 | |
| 8 | "github.com/urfave/cli/v3" |
| 9 | ) |
| 10 | |
| 11 | func cmdTunnel(ctx context.Context, cmd *cli.Command) error { |
| 12 | opts := clientruntime.TunnelOptions{ |
| 13 | Options: runtimeOptions(cmd), |
| 14 | ConfigPath: cmd.String("config"), |
| 15 | } |
| 16 | if cmd.IsSet("server") { |
| 17 | address := cmd.String("server") |
| 18 | opts.ServerAddress = &address |
| 19 | } |
| 20 | if cmd.IsSet("keyless") { |
| 21 | address := cmd.String("keyless") |
| 22 | opts.KeylessAddress = &address |
| 23 | } |
| 24 | return clientruntime.RunTunnel(ctx, opts) |
| 25 | } |