szimek / xmpp-chat

Facebook chat clone written using Strophe.js and Ember.js
168 stars 52 forks source link

Problem with Websockets #11

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi,

Im use Strophe.Websocket.js ( https://gist.github.com/739147 ) and node-xmpp-bosh (BOSH WebSockets; https://github.com/dhruvbird/node-xmpp-bosh ) over ejabberd.

I had to change this line in xmpp-chat: this.connection = new Strophe.Connection(this.host); to this.connection = new Strophe.WebSocket(this.host); and this.host = 'http://192.168.38.129:5280/http-bind'; to this.host = 'ws://192.168.38.129:5280'; in /js/chat/client.js

Strophe.WebSocket(this.host) instances an Strophe.Connection object

But I have problem with this. Can't connect to chat, and obviously I can't chat... I

Anyone know how to fix this problem?

bosh

PD: sorry for my english

ghost commented 11 years ago

I found the problem. The problem was that I was using the wrong protocol, this is the correct protocol for use with node-xmpp-bosh: https://github.com/superfeedr/strophejs/tree/protocol-ed, is running perfect with xmpp-chat

szimek commented 11 years ago

Great that you'd figured it out. I was thinking about making a working demo of this chat by deploying node-xmpp-bosh on Heroku (or somewhere else), but I never can find free time to do it :)