go-xmpp/cmd/xmpp_component/xmpp_component.go

21 lines
304 B
Go
Raw Normal View History

2018-01-11 21:15:54 +00:00
package main
2018-01-12 18:08:47 +00:00
import (
"fmt"
"fluux.io/xmpp"
)
2018-01-11 21:15:54 +00:00
func main() {
2018-01-12 17:14:41 +00:00
component := xmpp.Component{Host: "mqtt.localhost", Secret: "mypass"}
component.Connect("localhost:8888")
2018-01-12 18:08:47 +00:00
for {
_, packet, err := component.ReadPacket()
if err != nil {
return
}
fmt.Println("Packet received: ", packet)
}
2018-01-11 21:15:54 +00:00
}