mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-22 10:32:01 -08:00
22 lines
338 B
Go
22 lines
338 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"fluux.io/xmpp"
|
|
)
|
|
|
|
func main() {
|
|
component := xmpp.Component{Host: "mqtt.localhost", Secret: "mypass"}
|
|
component.Connect("localhost:8888")
|
|
|
|
for {
|
|
_, packet, err := component.ReadPacket()
|
|
if err != nil {
|
|
fmt.Println("read error", err)
|
|
return
|
|
}
|
|
fmt.Println("Packet received: ", packet)
|
|
}
|
|
}
|