1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 05:11:06 +02:00

websockets working

This commit is contained in:
Zack Scholl 2018-06-28 18:47:34 -07:00
parent 7a1f0f66cd
commit 22cd0afd11
5 changed files with 187 additions and 45 deletions

16
main.go
View file

@ -1,10 +1,22 @@
package main
import croc "github.com/schollz/croc/src"
import (
"flag"
croc "github.com/schollz/croc/src"
)
func main() {
var err error
role := flag.Int("role", 0, "role number")
flag.Parse()
c := croc.Init()
err := c.Relay()
if *role == 0 {
err = c.Relay()
} else if *role == 1 {
err = c.Send("foo")
}
if err != nil {
panic(err)
}