mirror of https://github.com/schollz/croc.git
parent
9968bbf824
commit
8b178881cf
|
@ -13,6 +13,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/schollz/croc/v6/src/croc"
|
"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/tcp"
|
||||||
"github.com/schollz/croc/v6/src/utils"
|
"github.com/schollz/croc/v6/src/utils"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
|
@ -66,7 +67,7 @@ func Run() (err error) {
|
||||||
cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"},
|
cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"},
|
||||||
cli.BoolFlag{Name: "yes", Usage: "automatically agree to all prompts"},
|
cli.BoolFlag{Name: "yes", Usage: "automatically agree to all prompts"},
|
||||||
cli.BoolFlag{Name: "stdout", Usage: "redirect file to stdout"},
|
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"},
|
cli.StringFlag{Name: "out", Value: ".", Usage: "specify an output folder to receive the file"},
|
||||||
}
|
}
|
||||||
app.EnableBashCompletion = true
|
app.EnableBashCompletion = true
|
||||||
|
|
|
@ -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, "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.Suffix = " waiting for recipient..."
|
||||||
// c.spinner.Start()
|
// c.spinner.Start()
|
||||||
// create channel for quitting
|
// create channel for quitting
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
package models
|
package models
|
||||||
|
|
||||||
const TCP_BUFFER_SIZE = 1024 * 64
|
const TCP_BUFFER_SIZE = 1024 * 64
|
||||||
|
const DEFAULT_RELAY = "142.93.177.120:9009"
|
||||||
|
|
Loading…
Reference in New Issue