Skip to main content

Posts

Showing posts with the label xmpp

Go, bots, go!

Earlier this year I started experimenting with the  Xmpp   protocol , and implemented bots in Python to communicate with an Xmpp server. I've now revisited those bots and reimplemented them in  Go . I've been meaning to learn Go for quite a while, and this seemed like a reasonable first project to tackle. The source code lives on GitHub:  https://github.com/snorristurluson/xmpp-chatbot If you are an experienced Go developer, I would appreciate any feedback and suggestions on how to improve the code - if you are just starting out with Go like myself, I hope this blog and the code is useful to you. As  before , I'm using  Prosody  to communicate with. Just like I did in Python, my first experiment is to simply open up a socket and poke the server to see where that takes us: func main () { conn , err := net. Dial ( " tcp " , " localhost:5222 " ) if err != nil { fmt. Errorf ( " Couldn't connect " ) } messa...

JumperBot

In a  previous blog  I described a simple echo bot, that echoes back anything you say to it. This time I will talk about a bot that generates traffic for the chat server, that can be used for load-testing both the chat server as well as any chat clients connected to it. I've dubbed it  JumperBot  - it jumps between chat rooms, saying a few random phrases in each room, then jumping to the next one. This bot builds on the same framework as the  EchoBot  - refer to the previous blog if you are interested in the details. The source lives on GitHub:  https://github.com/snorristurluson/xmpp-chatbot Configure the server In an  earlier blog  I described the setup of Prosody as the chat server to run against. Before we can connect bots to the server we have to make sure they can log in, either by creating accounts for them: prosodyctl register jumperbot_0 localhost jumperbot prosodyctl register jumperbot_1 localhost jumperbot ... or by ...