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.

Thursday, January 12, 2012

Moving Right Along

Previously...
  • I ran into the weird mod_adhoc problem again.
  • I discovered that there were version problems with ejabberd and erlang.
  • I created a new distribution and the mod_adhoc problem went away.

So getting back to where I was when the mod_adhoc problem derailed everything, I was planning to use erlang:decode_packet to provide the format that ejabberd_http was expecting.  In order to do that, I'm planning on stripping the header off the ECM packet that megaphone receives and then running decode_packet on the remaining binary.

This, of course, wont work at all.

The problem is that ECM is currently set up to handle all the HTTP stuff itself.  When it sends a packet to megaphone, it does not include all the HTTP headers and whatnot.  Therefore trying to decode for the HTTP headers and everything when they do not exist is not likely to work.

At this point, I need to make a decision: continue trying to use the HTTP bind route, in which case I will need to change ECM to be a raw TCP port so that it can pass HTTP headers and the like onto megaphone, or try and implement a more direct connection to ejabberd, that acts more like a regular connection and does not bother with HTTP headers.

I'm going with the route that turns ECM into a TCP socket concentrator mostly because I don't want to deal with the BOSH aspect right now.  While there will be problems, like how to buffer connection data, at least I wont have to deal with BOSH issues like supporting different streams and the like.

Next steps
  • Modify ECM to stop parsing HTTP.
  • Modify megaphone to use erlang:decode_packet 

No comments:

Post a Comment