func main() { wray.RegisterTransports([]wray.Transport{&gofaye.HttpTransport{}}) client := wray.NewFayeClient("http://localhost:5000/faye") params := map[string]interface{}{"hello": "from golang"} fmt.Println("sending") client.Publish("/foo", params) }
func main() { wray.RegisterTransports([]wray.Transport{&wray.HttpTransport{}}) client := wray.NewFayeClient("http://localhost:5000/faye") fmt.Println("subscribing") client.Subscribe("/foo", false, func(message wray.Message) { fmt.Println("-------------------------------------------") fmt.Println(message.Data) }) client.Listen() }