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, March 15, 2012

Any Progress is Good Progress

Previously...
  • I wrote some new code to process requests.
  • I turned it on and...it didn't work.
  • I changed the system to stop sending "raw" HTTP.

I looked around at the way a connection using Pidgin to port 5280 worked and noticed that the IP address I was using was probably not in the expected format.  Whereas ejabberd was expecting something like this:

    {{127,0,0,1}, 1234} 

I was giving it something like this:

    <<127,0,0,1>>

I changed it over and ejabberd seemed much happier.  At least until it hit the next problem.

Now it is complaining about the following:

=ERROR REPORT==== 2012-03-15 20:21:23 ===
Error in process <0.379.0> on node 'ejabberd@localhost' with exit value: {badarg,[{erlang,length,[{200,[{"Content-Type","text/xml; charset=utf-8"},{"Access-Control-Allow-Origin","*"},{"Access-Control-Allow-Headers","Content-Type"}],<<763 bytes>>}]},{megaphone_sender,send_packet,3},{megaphone_sender,main_loop... 

Which looks like megaphone is gagging on what ejabberd is returning --- raw HTTP instead of just an XML body.  The good news is that means that I don't have to worry about how to get a complete HTTP response from what ejabberd gives me.  All I have to do is just stream what I get back to ECM and let that in turn stream it back to the client.

So all in all, a good day working at the code.

Next time: modifying megaphone to pass back raw HTTP to ECM.

No comments:

Post a Comment