5 Replies - 5031 Views - Last Post: 02 November 2012 - 08:18 AM

#1 adn258  Icon User is offline

  • D.I.C Addict

Reputation: 11
  • View blog
  • Posts: 762
  • Joined: 31-August 11

How Do Simple Text Chat Sites Like Omegle Work?

Posted 23 October 2012 - 02:12 AM

So I know that sounds weird and it's not like I plan on making my own but how do sites like http://www.omegle.com/ with a simple web chat work?? What do you use for that?? I'm just curious someday in case I ever want to make a chat or something.
Is This A Good Question/Topic? 0
  • +

Replies To: How Do Simple Text Chat Sites Like Omegle Work?

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: How Do Simple Text Chat Sites Like Omegle Work?

Posted 23 October 2012 - 02:19 AM

I'd imagine they have a list of available users registered server-side, using PHP or ASP.NET or etc..., listed along with that interest string. Then they match new chats using that, and provide a web-chat written in Javascript, using either AJAX, long polling or the new HTML5 sockets interface to connect to the server and push and pull messages. (My money would be on AJAX.)

Of course, I haven't actually tried that thing so it's also possible that they use a 3rd party plugin like Flash or Java for the client. They'd have to do that for the video chat, at least.
Was This Post Helpful? 0
  • +
  • -

#3 Redcoder  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 13
  • Joined: 11-June 12

Re: How Do Simple Text Chat Sites Like Omegle Work?

Posted 24 October 2012 - 06:51 AM

Omegle.com uses Flash for chat and Ajax for getting server status. But if you want to make your chat app in the future, use the Comet model or sockets. I say model because Comet encompasses different technologies that achieve a persistent connection between the client and the server. Web sockets achieves the same only that this time it's a protocol - although only supported in newer browsers.

Although I did once make a chat app using AJAX, it kept going down because I had hosted it on a free web host which did not allow such aggressive pinging as I had inbuilt in the app.

Check out Sockets.io here and here, easy to use and it leverages the best technology available on the client so it can be used on many browsers and devices.

Sockets can be applied in many situations and not just chat apps but apps that require real-time user interaction like Online Multi-player games e.t.c . So it's worth having knowledge about.
Was This Post Helpful? 1
  • +
  • -

#4 adn258  Icon User is offline

  • D.I.C Addict

Reputation: 11
  • View blog
  • Posts: 762
  • Joined: 31-August 11

Re: How Do Simple Text Chat Sites Like Omegle Work?

Posted 24 October 2012 - 01:08 PM

View PostRedcoder, on 24 October 2012 - 06:51 AM, said:

Omegle.com uses Flash for chat and Ajax for getting server status. But if you want to make your chat app in the future, use the Comet model or sockets. I say model because Comet encompasses different technologies that achieve a persistent connection between the client and the server. Web sockets achieves the same only that this time it's a protocol - although only supported in newer browsers.

Although I did once make a chat app using AJAX, it kept going down because I had hosted it on a free web host which did not allow such aggressive pinging as I had inbuilt in the app.

Check out Sockets.io here and here, easy to use and it leverages the best technology available on the client so it can be used on many browsers and devices.

Sockets can be applied in many situations and not just chat apps but apps that require real-time user interaction like Online Multi-player games e.t.c . So it's worth having knowledge about.


Thanks guys. Ok so I get that and I really appreciate you pointing me to this. What is it though with all this flash? There isn't like a flash programming language is there? How does someone use "flash" to do all of these things like a Chat? I'm confused.

ALSO how does one go about using WEBSOCKETS is that just an API built in html5 or javascript or something?

This post has been edited by adn258: 24 October 2012 - 01:10 PM

Was This Post Helpful? 0
  • +
  • -

#5 Redcoder  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 13
  • Joined: 11-June 12

Re: How Do Simple Text Chat Sites Like Omegle Work?

Posted 24 October 2012 - 04:01 PM

Flash uses sockets. Here's how.

The WebSocket specification defines an API establishing "socket" connections between a web browser and a server. Socket connections are persistent connections between a client and the server.

Check out this article which explains HTTP, AJAX, Flash and Ajax.

So web sockets is an API which only works in HTML5 as far as I know- unless some Library has made it possible in XHTML. Frameworks like Socket.io make implementation a breeze.
Was This Post Helpful? 0
  • +
  • -

#6 depricated  Icon User is offline

  • DLN-000

Reputation: 722
  • View blog
  • Posts: 2,441
  • Joined: 13-September 08

Re: How Do Simple Text Chat Sites Like Omegle Work?

Posted 02 November 2012 - 08:18 AM

View Postadn258, on 24 October 2012 - 02:08 PM, said:

Thanks guys. Ok so I get that and I really appreciate you pointing me to this. What is it though with all this flash? There isn't like a flash programming language is there? How does someone use "flash" to do all of these things like a Chat? I'm confused.

There IS a "Flash Programming Language" - it's called ActionScript3

It reads/writes somewhat similar to Java, but naturally has its own idiosyncracies and libraries.

You can use the FlashDevelop IDE to write in it without having to get a copy of Adobe's IDE - though Adobe has been known to license copies for learning to develop, so long as you agree not to publish anything made using that copy (unless you buy a license). They gave me one, and it really impressed me with Adobe, I'm kinda fanboyish about them because of that. I was afraid I wouldn't be able to learn the language and IDE without forking over a ton of cash - now I've actually come across needing it for work a couple times and being able to whip out knowledge of it.

So you could ask Adobe nicely for a copy to learn on, or you could use FlashDevelop if you just want to learn and publish the code.

http://www.flashdevelop.org/
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1