What is Megaphone?

What is Megaphone?
The Megaphone project is about enhancing open source chat software. Specifically, the goal is to allow ejabberd to support 1,000,000 simultaneous users. See The Plan page for more details on how I plan to solve this problem. See the About this Blog page for more details on why I created this blog.

Friday, March 23, 2012

Content Length Required

Previously...
  • I solved the undelivered data problem and added heartbeats.
  • I solved the endless loop problem.
  • I noted that ECM is a piece of junk.

In an attempt to get Pidgin and megaphone to talk to each other I tried looking at a conversation via wireshark.  Pidgin was using port 5280 (BOSH) in this example, thereby bypassing megaphone.  Here is some of the conversation:


POST /http-bind/ HTTP/1.1
Host: ubuntu2
User-Agent: Pidgin 2.6.6 (libpurple 2.6.6)
Content-Encoding: text/xml; charset=utf-8
Content-Length: 225

<body content='text/xml; charset=utf-8' secure='true' to='ubuntu2' xml:lang='en' xmpp:version='1.0' ver='1.6' xmlns:xmpp='urn:xmpp:xbosh' rid='2652978132620311' wait='60' hold='1' xmlns='http://jabber.org/protocol/httpbind'/>HTTP/1.1 200 OK
Content-Length: 764
Content-Type: text/xml; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

<body xmlns='http://jabber.org/protocol/httpbind' sid='860957cf51a1a6420b82b482853285a914afba43' wait='60' requests='2' inactivity='30' maxpause='120' polling='2' ver='1.8' from='ubuntu2' secure='true' authid='219217664' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' xmpp:version='1.0'><stream:features xmlns:stream='http://etherx.jabber.org/streams'><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='yy7di5kE0syuCXOQTXNBTclpNTo='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features></body>

Consider now the conversation that I see going on between Pidgin and ECM:


HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type


<body xmlns='http://jabber.org/protocol/httpbind' sid='48f09e6c35ad89c27f0d82ae348110f58137d251' wait='60' requests='2' inactivity='30' maxpause='120' polling='2' ver='1.8' from='ubuntu2' secure='true' authid='539841753' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' xmpp:version='1.0'><stream:features xmlns:stream='http://etherx.jabber.org/streams'><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='yy7di5kE0syuCXOQTXNBTclpNTo='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features></body>

In addition to being gibberish, it also shows that the responses from megaphone are not including content-length headers in their responses.  This is likely (one of) the problem(s) that is causing the two of them to fail to communicate.  

So solving this problem will cause everything to just magically work.

I'm serious this time.

Next time: a solution to this problem.

No comments:

Post a Comment