Skip to content

Commit bdbb230

Browse files
authored
allow customizable port for fly mpg proxy (#4702)
add customizable port for fly mpg proxy
1 parent 6bcf876 commit bdbb230

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

internal/command/mpg/proxy.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ func newProxy() (cmd *cobra.Command) {
3232
Default: "127.0.0.1",
3333
Description: "Local address to bind to",
3434
},
35+
flag.String{
36+
Name: flagnames.LocalPort,
37+
Shorthand: "p",
38+
Default: "16380",
39+
Description: "Local port to proxy on",
40+
},
3541
)
3642

3743
cmd.Args = cobra.MaximumNArgs(1)
@@ -45,7 +51,7 @@ func runProxy(ctx context.Context) (err error) {
4551
return err
4652
}
4753

48-
localProxyPort := "16380"
54+
localProxyPort := flag.GetString(ctx, flagnames.LocalPort)
4955
_, params, _, err := getMpgProxyParams(ctx, localProxyPort, "")
5056
if err != nil {
5157
return err

internal/flag/flagnames/constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ const (
4949
// BindAddr denotes the name of the local bind address flag.
5050
BindAddr = "bind-addr"
5151

52+
// LocalPort denotes the name of the local MPG proxy port flag.
53+
LocalPort = "local-port"
54+
5255
// ProcessGroup denotes the name of the process group flag.
5356
ProcessGroup = "process-group"
5457

0 commit comments

Comments
 (0)