cburschka / cadence

A strophe.js-powered XMPP web client for chatrooms.
7 stars 2 forks source link

Support WebSockets if available #320

Closed cburschka closed 8 years ago

cburschka commented 8 years ago

I totally missed these interesting things.

  1. WebSockets (RFC-6455) is a thing.
  2. Most major browsers support it now
  3. Strophe supports it

Why aren't we using it? Because BOSH is hard-coded into cadence right now. If config.xmpp.boshURL were supplemented with config.xmpp.wssURL, we could use both - even falling back to BOSH if WSS throws an exception.

cburschka commented 8 years ago

Also we (specifically CalRef) couldn't use it before ejabberd implemented it this year.

cburschka commented 8 years ago

Also, we still can't use it, because we're on 2.1.10, and Debian will probably update it in 10-20 years or something.

cburschka commented 8 years ago

It's surprisingly easy to support on the client end, though - setting config.xmpp.boshURL to something like ws://.../ is enough.

Full support requires renaming config.xmpp.boshURL to something generic like config.xmpp.url, doing the same in ./configure, and maybe adding a shortcut flag (like "--websocket,-w") that will automatically default the URL to "wss?://server:528[01]/websocket" instead of "https?://server:528[01]/http-bind/".

The default without a --websocket flag should remain BOSH for the foreseeable future because support is still pretty dinky.