Copyleft Games

Intro to XMPP

XMPP is an Internet standard which we use for chat and game networking. Understanding what it is and how it works is a good first step in tackling many of our Google Code-in tasks.

XMPP stands for eXtensible Message and Presence Protocol. Its based on XML similar to HTML. Where HTML documents begin with <html>, XMPP streams begin with a "stream" root element such as: <stream:stream to='gci.copyleftgames.org' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

After authentication, three special XML elements are found inside the stream: iq, message, and presence. These elements and everything within them are called stanzas, and these have "from" and "to" attributes which allow them to be routed to other users. For example, if Alice sends a message to Bob it might look like <message from="alice@gci.copyleftgames.org" to="bob@gci.copyleftgames.org" id="100" type="chat"><body>Hi, Bob!</body></message>

RFC 6121 goes into much more detail if you're interested, but doing is better than reading!

Start by connecting to our web-based chat an enabling the XML Console (below the chat window), watch how XMPP works by sending and receiving messages.

To complete this task, use the XML console to craft a custom <message> stanza with both a <helloworld/> element and a normal <body> element to the gci room. This demonstrates you have a fundamental understanding of XMPP and are ready tackle greater challenges!

Task tags

  • xmpp
  • chat

Students who completed this task

JJJPPP, Nicolás Hernán Rickert, Jarrett B, Wee He-Kun, Ravineel Singhi, Choudhury Istasis Mishra, Alex M., Lequert, Vidminas Mikucionis, daver_12345, Balázs Kozák, DumboOctopus, Tanvish, Austin Jenchi, Shrix, Abdullah Shuaib, David Yi, Mihai Zorila, Jared Santa Maria, Aneesh Chawla, jammurz, kalculator, LED, Brendan Early, Marissa Angell, Mzubair00, Jeff Sieu Yong, Leslie, daniellimweesoong, Liam, Mehmet Cagri Ari

Task type

  • chrome_reader_mode Documentation / Training
  • web Design
  • assessment Outreach / Research

Level

Beginner
close

2016