cwtch/app/peer/alice/alice.go

21 lines
380 B
Go
Raw Normal View History

2018-10-04 19:15:03 +00:00
package main
import (
"cwtch.im/cwtch/peer"
2018-12-04 02:52:11 +00:00
"git.openprivacy.ca/openprivacy/libricochet-go/log"
2018-10-04 19:15:03 +00:00
)
func main() {
2018-12-04 02:52:11 +00:00
log.AddEverythingFromPattern("peer/alice")
2018-10-06 03:50:55 +00:00
alice := peer.NewCwtchPeer("alice")
2018-10-04 19:15:03 +00:00
processData := func(onion string, data []byte) []byte {
2018-12-04 02:52:11 +00:00
log.Debugf("Recieved %s from %v", data, onion)
2018-10-04 19:15:03 +00:00
return data
}
alice.SetPeerDataHandler(processData)
alice.Listen()
2018-12-04 02:52:11 +00:00
2018-10-04 19:15:03 +00:00
}