Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

AJAX chat (instant messaging) module/widget


Go to End


12 Posts   8057 Views

Avatar
rino

Community Member, 12 Posts

27 January 2009 at 5:48am

Edited: 27/01/2009 5:57am

i'm working on a chat (or instant messaging) module/widget for my http://micromusic.net project. is someone interested in such a module? you can see a demo here:

http://2009.micromusic.org

log in as

login: tester
password: test

and/or

login: tester2
password: test

best in 2 different browsers (or IE) to check the messaging functionality. Firefox tabs use the same session!

my plan is to add the chat module to the Silverstripe module library, but i need to clean up some code first.

if you are interested in helping me out with implementing more functionality like:

- preferences settings
- blocking user functionality
- chat functionality on the ChatPage
- friends list
etc.

or debugging the code, let me know.

all feedback is welcome anyway!!!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

27 January 2009 at 6:26am

Very cool. Great idea. I was thinking about this yesterday. Is that really how chat applications work on the web? With AJAX? There must be some other secret, because on sites like Facebook and Gmail, the response time is nearly instantaneous.

Avatar
rino

Community Member, 12 Posts

27 January 2009 at 11:47am

Edited: 27/01/2009 11:52am

i cant really think of another way than refreshing the content of the widget every 10s or so by using AJAX technology.

i'm using a simular but simpler "chat system" on micromusic.net for about 10 years already, and it worked pretty well so far. of course you can write more sophisticated code which will have some dynamic refresh periods depending on the activity of the user to make the chat more responsive or - the other direction - save some web server resources while you're not chatting to someone etc.

if you're interested in what facebook is doing exactly you should install the "Live HTTP Headers" Add-on in Firefox to check the requests/responses AJAX is sending and receiving.

Avatar
lenix

Community Member, 3 Posts

28 January 2009 at 10:00am

for this purpose there is "BOSH" - http://xmpp.org/extensions/xep-0124.html


BOSH is "Bidirectional-streams Over Synchronous HTTP", a technology for two-way communication over the Hypertext Transfer Protocol (HTTP). BOSH emulates many of the transport primitives that are familiar from the Transmission Control Protocol (TCP). For applications that require both "push" and "pull" communications, BOSH is significantly more bandwidth-efficient and responsive than most other bidirectional HTTP-based transport protocols and the techniques known as AJAX. BOSH achieves this efficiency and low latency by avoiding HTTP polling, yet it does so without resorting to chunked HTTP responses as is done in the technique known as Comet. To date, BOSH has been used mainly as a transport for traffic exchanged between Jabber/XMPP clients and servers (e.g., to facilitate connections from web clients and from mobile clients on intermittent networks). However, BOSH is not tied solely to XMPP and can be used for other kinds of traffic, as well.

if i remember correctly it just uses a single keep-alive http-connection where the server pushes the javascript-parts that should be executed at client side, but it has been quiet a while since i read about all that stuff.

for an example see jwchat (http://blog.jwchat.org/jwchat/) and punjab (http://code.stanziq.com/punjab), a browser-based jabber-over-http stack.

Avatar
rino

Community Member, 12 Posts

28 January 2009 at 10:45am

OK, that looks nice. but as far as i understand you need a special server to establish such a bidirectional BOSH connection?

I aim at a solution based on Silverstripe, PHP, JavaScript, MySQL and a standard web server (apache/ISS), that doesnt need any other technology.

Avatar
schellmax

Community Member, 126 Posts

12 February 2009 at 12:44am

hello,
social network capabilities are something i'm sorely missing in the otherwise really great silverstripe framework.
there are some posts in the forum talking about a module to achieve this, but unfortunately there are no results on this.
i'd really love to do something alike for a current project, but i guess time&money will hold me back (as most of the other developers out there).
nevertheless i'm interested in what you've done here (looking nice!) - maybe you want to place your code somewhere for download
all the best
max

Avatar
rino

Community Member, 12 Posts

12 February 2009 at 12:48am

I'll definitely publish the source code, i just need to clean out the whole thing in th next few days. Hope to have it ready next week. And hopefully the module/widget will be helpfull for you all and someone will try and help to improve it...

More about it soon here!!!

Avatar
baba-papa

Community Member, 279 Posts

26 January 2010 at 5:57pm

Hello rino,

I tried to install your chat module on my site (SS version 2.3.1) but it didn´t work. First I get a template error. When I´m dragging the chat box widget to my blog sidebar I get the following error message:
Fatal error: Call to undefined method Page::currentlyonline() in /var/www/1000/musik-kaiserslautern.de/htdocs/mm_chat/code/ChatPage.php on line 275

My Page.php doesn´t have a method currentlyonline().

Is this problem easy to fix? If not I would create a chat myself.

Go to Top