Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » AJAX chat (instant messaging) module/widget

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 5320 Views
  • rino
    Avatar
    Community Member
    12 Posts

    AJAX chat (instant messaging) module/widget Link to this post

    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!!!

  • UncleCheese
    Avatar
    4085 Posts

    Re: AJAX chat (instant messaging) module/widget Link to this post

    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.

  • rino
    Avatar
    Community Member
    12 Posts

    Re: AJAX chat (instant messaging) module/widget Link to this post

    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.

  • lenix
    Avatar
    Community Member
    3 Posts

    Re: AJAX chat (instant messaging) module/widget Link to this post

    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.

  • rino
    Avatar
    Community Member
    12 Posts

    Re: AJAX chat (instant messaging) module/widget Link to this post

    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.

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: AJAX chat (instant messaging) module/widget Link to this post

    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

  • rino
    Avatar
    Community Member
    12 Posts

    Re: AJAX chat (instant messaging) module/widget Link to this post

    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!!!

  • baba-papa
    Avatar
    Community Member
    279 Posts

    Re: AJAX chat (instant messaging) module/widget Link to this post

    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.

    5320 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.