diff --git a/src/cli/cli.go b/src/cli/cli.go index 5ddc1d5..073be83 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -13,6 +13,7 @@ import ( "time" "github.com/schollz/croc/v6/src/croc" + "github.com/schollz/croc/v6/src/models" "github.com/schollz/croc/v6/src/tcp" "github.com/schollz/croc/v6/src/utils" "github.com/urfave/cli" @@ -66,7 +67,7 @@ func Run() (err error) { cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"}, cli.BoolFlag{Name: "yes", Usage: "automatically agree to all prompts"}, cli.BoolFlag{Name: "stdout", Usage: "redirect file to stdout"}, - cli.StringFlag{Name: "relay", Value: "142.93.177.120:9009", Usage: "address of the relay"}, + cli.StringFlag{Name: "relay", Value: models.DEFAULT_RELAY, Usage: "address of the relay"}, cli.StringFlag{Name: "out", Value: ".", Usage: "specify an output folder to receive the file"}, } app.EnableBashCompletion = true diff --git a/src/croc/croc.go b/src/croc/croc.go index fdbc326..d05af88 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -215,7 +215,11 @@ func (c *Client) Send(options TransferOptions) (err error) { } fmt.Fprintf(os.Stderr, "Sending %s (%s)\n", fname, utils.ByteCountDecimal(totalFilesSize)) - fmt.Fprintf(os.Stderr, "Code is: %s\nOn the other computer run\n\ncroc %s\n", c.Options.SharedSecret, c.Options.SharedSecret) + otherRelay := "" + if c.Options.RelayAddress != models.DEFAULT_RELAY { + otherRelay = "--relay " + c.Options.RelayAddress + " " + } + fmt.Fprintf(os.Stderr, "Code is: %s\nOn the other computer run\n\ncroc %s%s\n", c.Options.SharedSecret, otherRelay, c.Options.SharedSecret) // // c.spinner.Suffix = " waiting for recipient..." // c.spinner.Start() // create channel for quitting diff --git a/src/models/constants.go b/src/models/constants.go index f1b11e6..acb20a7 100644 --- a/src/models/constants.go +++ b/src/models/constants.go @@ -1,3 +1,4 @@ package models const TCP_BUFFER_SIZE = 1024 * 64 +const DEFAULT_RELAY = "142.93.177.120:9009"