display relay in UI if not using default

Fixes #143
This commit is contained in:
Zack Scholl 2019-07-17 14:12:48 -06:00
parent 9968bbf824
commit 8b178881cf
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -1,3 +1,4 @@
package models
const TCP_BUFFER_SIZE = 1024 * 64
const DEFAULT_RELAY = "142.93.177.120:9009"