mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
pake works between two clients
This commit is contained in:
parent
f6751dadb9
commit
72e2d4d3d8
7 changed files with 124 additions and 108 deletions
5
main.go
5
main.go
|
@ -9,15 +9,16 @@ import (
|
|||
func main() {
|
||||
var err error
|
||||
role := flag.Int("role", 0, "role number")
|
||||
passphrase := flag.String("code", "chou", "codephrase")
|
||||
flag.Parse()
|
||||
|
||||
c := croc.Init()
|
||||
if *role == -1 {
|
||||
err = c.Relay()
|
||||
} else if *role == 0 {
|
||||
err = c.Send("foo")
|
||||
err = c.Send("foo", *passphrase)
|
||||
} else {
|
||||
err = c.Receive()
|
||||
err = c.Receive(*passphrase)
|
||||
}
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue