[jdev] Simple JavaScript XMPP client example

Chris Fortmüller chritsche at gmail.com
Tue Sep 2 16:13:03 UTC 2014


@Kirk, thanks for the suggestions, will have a look.

@Steven: The purpose of all this testing is that I hope on writing a little
instant messenger app for android, which will have local html/javascript
pages within the application package, which are supposed to host the xmpp
code. So following your post, under this scenario, I will also face CORS
issues? Will need to investigate this further

Thanks to all!

Chris


On Tue, Sep 2, 2014 at 5:44 PM, Kirk Bateman <kirk.bateman at gmail.com> wrote:

> Metajack's book (Jack Moffitt) has good setup and examples for strophe and
> bosh proxying
>
> "Professional XMPP Programming with Javascript and jquery"
>
> There are probably some bits of help on his blog too (check the archive),
> http://metajack.im
>
> Cheers
>
> Kirk Bateman
>
>
> On 2 September 2014 16:41, Steven Lloyd Watkin <lloyd at evilprofessor.co.uk>
> wrote:
>
>> Generally its easer to serve your site on https://site.com and proxy
>> bosh at something like site.com/http-bind/. Otherwise you'll hit CORS
>> issues. So in summary, yes you are correct ;)
>>
>> _____________________________________________________
>>
>> Steven Lloyd Watkin
>> Software Engineer
>> PHP ::: Java ::: Ruby ::: Node.js ::: XMPP
>> lloyd at evilprofessor.co.uk (email+jid) ::: http://www.evilprofessor.co.uk
>> Facebook / Twitter / Flickr: lloydwatkin
>>
>> Organiser of WORLD RECORD breaking charity event:
>> Scuba Santas ::: http://www.scuba-santas.co.uk
>> Supporting the RNLI & DDRC - 15th December 2013 - NDAC, Chepstow
>>
>>
>> On 2 September 2014 16:34, Chris Fortmüller <chritsche at gmail.com> wrote:
>>
>>> @Christian: yes, I tried this, no change.
>>>
>>> @Stefan: I am just opening the local html file in chrome,
>>> i.e.file:///C:/Users/B/Desktop/strophejs-master/strophejs-master/examples/echobot.html.
>>>
>>> Your saying I need to access it somehow like
>>> http://localhost:5280/myfile.html?
>>>
>>>
>>>
>>> On Tue, Sep 2, 2014 at 5:24 PM, Stefan Strigler <
>>> stefan.strigler at gmail.com> wrote:
>>>
>>>> Where are you loading your html file from? This needs to be served from
>>>> the same host and port than your service (i.e. localhost:5280).
>>>> Alternatively you'd need to supply a crossdomain.xml that allows your
>>>> html/javascript to connect to any host/port.
>>>>
>>>> .Stefan
>>>>
>>>>
>>>> 2014-09-01 21:54 GMT+02:00 Chris Fortmüller <chritsche at gmail.com>:
>>>>
>>>> Thanks to all for your answers.
>>>>>
>>>>> Johannes, I have tried the echobot example, changing var BOSH_SERVICE
>>>>> to 'http://localhost:5280/http-bind', where my BOSH service is up and
>>>>> running.
>>>>>
>>>>> When I try to connect in echobot.html, I just get
>>>>>
>>>>> Strophe is connecting.
>>>>> Strophe failed to connect.
>>>>> Strophe is disconnected.
>>>>> Strophe is connecting.
>>>>> Strophe failed to connect.
>>>>> Strophe is disconnected.
>>>>> Strophe is connecting.
>>>>> Strophe failed to connect.
>>>>> Strophe is disconnected.
>>>>> Strophe is connecting.
>>>>> Strophe failed to connect.
>>>>> Strophe is disconnected.
>>>>>
>>>>> So, a bunch of failed attempts. Not sure what the issue is
>>>>>
>>>>>
>>>>> On Mon, Sep 1, 2014 at 4:44 PM, Steven Lloyd Watkin <
>>>>> lloyd at evilprofessor.co.uk> wrote:
>>>>>
>>>>>> There's also an older version of node-xmpp which can be browserified
>>>>>> and run directly in the browser. Version 1.0.0 is getting closer to release
>>>>>> (it is available through npm) but currently browserify is broken - probably
>>>>>> my fault.
>>>>>>
>>>>>> Lloyd
>>>>>>
>>>>>> _____________________________________________________
>>>>>>
>>>>>> Steven Lloyd Watkin
>>>>>> Software Engineer
>>>>>> PHP ::: Java ::: Ruby ::: Node.js ::: XMPP
>>>>>> lloyd at evilprofessor.co.uk (email+jid) :::
>>>>>> http://www.evilprofessor.co.uk
>>>>>> Facebook / Twitter / Flickr: lloydwatkin
>>>>>>
>>>>>> Organiser of WORLD RECORD breaking charity event:
>>>>>> Scuba Santas ::: http://www.scuba-santas.co.uk
>>>>>> Supporting the RNLI & DDRC - 15th December 2013 - NDAC, Chepstow
>>>>>>
>>>>>>
>>>>>> On 1 September 2014 14:51, Hund, Johannes <johannes.hund at siemens.com>
>>>>>> wrote:
>>>>>>
>>>>>>>  Hi Christopher,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> looks like a sasl  Problem.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I recently whipped something up using strophe.js and found this
>>>>>>> example quite useful:
>>>>>>>
>>>>>>> https://github.com/strophe/strophejs/blob/master/examples/echobot.js
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Worked out of the box with openfire.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Johannes
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *Von:* JDev [mailto:jdev-bounces at jabber.org] *Im Auftrag von *Christopher
>>>>>>> Fortmüller
>>>>>>> *Gesendet:* Montag, 1. September 2014 15:02
>>>>>>> *An:* jdev at jabber.org
>>>>>>> *Betreff:* [jdev] Simple JavaScript XMPP client example
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I am running an ejabberd server for testing purposes.
>>>>>>>
>>>>>>> I am now looking for a very basic example of a working
>>>>>>> JavaScript/html client to log in to this server.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I have tried several JavaScript libraries so far, unfortunately, to
>>>>>>> no avail. Would also appreciate input on my post on stackoverflow, if
>>>>>>> anyone has any:
>>>>>>> http://stackoverflow.com/questions/25601350/ejabberd-authentication-configuration-for-plain-or-md5-digest-for-javascript-con
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I tried connecting with jQueryXmpp in that case.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks for any and all help,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Chris
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> JDev mailing list
>>>>>>> Info: http://mail.jabber.org/mailman/listinfo/jdev
>>>>>>> Unsubscribe: JDev-unsubscribe at jabber.org
>>>>>>> _______________________________________________
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> JDev mailing list
>>>>>> Info: http://mail.jabber.org/mailman/listinfo/jdev
>>>>>> Unsubscribe: JDev-unsubscribe at jabber.org
>>>>>> _______________________________________________
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> JDev mailing list
>>>>> Info: http://mail.jabber.org/mailman/listinfo/jdev
>>>>> Unsubscribe: JDev-unsubscribe at jabber.org
>>>>> _______________________________________________
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> JDev mailing list
>>>> Info: http://mail.jabber.org/mailman/listinfo/jdev
>>>> Unsubscribe: JDev-unsubscribe at jabber.org
>>>> _______________________________________________
>>>>
>>>>
>>>
>>> _______________________________________________
>>> JDev mailing list
>>> Info: http://mail.jabber.org/mailman/listinfo/jdev
>>> Unsubscribe: JDev-unsubscribe at jabber.org
>>> _______________________________________________
>>>
>>>
>>
>> _______________________________________________
>> JDev mailing list
>> Info: http://mail.jabber.org/mailman/listinfo/jdev
>> Unsubscribe: JDev-unsubscribe at jabber.org
>> _______________________________________________
>>
>>
>
> _______________________________________________
> JDev mailing list
> Info: http://mail.jabber.org/mailman/listinfo/jdev
> Unsubscribe: JDev-unsubscribe at jabber.org
> _______________________________________________
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20140902/234e640b/attachment-0001.html>


More information about the JDev mailing list