views:

720

answers:

4

I want to implement a chat site with following features:

  1. Direct one-on-one chat with a randomly picked stranger
  2. If my conversation partner gets disconnected, I should be shifted to different stranger

In short, I want to imitate http://omegle.com/

Which language is best suited to this task? Jsp and Java? PHP? ASP? Others?

Should all of the messages go through the web server, or is there a better approach?

A: 

I recently created a chat script using PHP + AJAX. Yes, all of my chat messages went through the server because it used AJAX and server-side PHP scripting to deliver the messages to the recipient(s).

For an example of a PHP chat script, see: http://www.phpfreechat.net/

JasonV
Note: PHP isn't necessarily the best language for the task. That is subjective, and I didn't delve into that topic in my post.
JasonV
+1  A: 

You may want to look into Google Web Toolkit (GWT). Ryan Dewsbury's book "Google Web Toolkit Applications" actually runs you through the process of writing a basic chat application.

GWT lets you write Java code that is compiled into Javascript for AJAX applications.

thedude19
+1  A: 

I wrote an AJAX Chat tutorial years ago at:

http://www.dynamicajax.com/fr/AJAX_Driven_Web_Chat-271_290_291.html

I also did a JSON version of it too:

http://www.dynamicajax.com/fr/JSON_AJAX_Web_Chat-271_290_324.html

Those are written in PHP but the back end is really simple so you can port it to whatever language you want easily. Here's a version that I converted to ASP.NET

http://www.dynamicajax.com/fr/AJAX_Web_Chat_ASP_NET-271_290_328.html

It works pretty much like Omegle, all you need to do is setup the code to randomly select a stranger.

Ryan Smith
Thanks for the post, It gave me ideas for GAE Chat.
Josh Patton
A: 

Hi,

I've recently published an opensource chatting application over at CodePlex. It takes inspiration from Google Talk as well as Facebook chat.

Check it out @ http://aspnetjquerychat.codeplex.com/

Ali Kazmi