mikemarsian-ruby_bosh 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -6
- data/ruby_bosh.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 831fff9ccd8c05dc026537e96a214058b6d372bb
|
4
|
+
data.tar.gz: 93712d84cf93fdb85400b6024dcefc9f9e87f674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dacab7e386fc6f7553460e0cc60236a40e99fa09a4880a65e6810394f8ce81558e35aabd990598edc7121c1e5a2413aa20b3313bb4e35ec1622b292b90348046
|
7
|
+
data.tar.gz: 92da6209cd4c7c0129e980f01ddf6abf1a9accab75c4012cc285718f11382fade65b033d6774397a87717cd0803ecbc2cacbcd00e25663b08ac78fffa52866a0
|
data/README.md
CHANGED
@@ -15,29 +15,36 @@ XMPP via BOSH: http://xmpp.org/extensions/xep-0206.html
|
|
15
15
|
|
16
16
|
In your Ruby app controller (or equivalent):
|
17
17
|
|
18
|
+
```ruby
|
18
19
|
@session_jid, @session_id, @session_random_id =
|
19
20
|
RubyBOSH.initialize_session("me@jabber.org", "my_password", "http://localhost:5280/http-bind")
|
21
|
+
```
|
20
22
|
|
21
23
|
If you want to define your own resource name, include it within the jid. RubyBOSH will create a random one if none is supplied.
|
22
24
|
To define a resource name of 'home', do the following:
|
23
25
|
|
26
|
+
```ruby
|
24
27
|
@session_jid, @session_id, @session_random_id =
|
25
28
|
RubyBOSH.initialize_session("me@jabber.org/home", "my_password", "http://localhost:5280/http-bind")
|
29
|
+
```
|
26
30
|
|
27
31
|
In your template, you would then pass these directly to your javascript BOSH connector:
|
28
32
|
|
33
|
+
``` erb
|
29
34
|
var bosh_jid = '<%= @session_jid %>';
|
30
35
|
var bosh_sid = '<%= @session_id %>';
|
31
36
|
var bosh_rid = '<%= @session_random_id %>';
|
37
|
+
```
|
32
38
|
|
39
|
+
``` js
|
33
40
|
// using Strophe:
|
34
|
-
connect.attach(bosh_jid, bosh_sid, bosh_rid, onConnectHandlerFunction);
|
41
|
+
connect.attach(bosh_jid, bosh_sid, bosh_rid, onConnectHandlerFunction);
|
42
|
+
```
|
35
43
|
|
36
|
-
Acknowledgements
|
37
|
-
|
38
|
-
Jack Moffit
|
39
|
-
- thanks for the nice Django example :)
|
40
|
-
#=> http://metajack.im/2008/10/03/getting-attached-to-strophe/
|
44
|
+
## Acknowledgements
|
45
|
+
|
46
|
+
Jack Moffit - thanks for the [nice Django example](http://metajack.im/2008/10/03/getting-attached-to-strophe/)
|
41
47
|
|
42
48
|
Copyright (c) 2008 Pradeep Elankumaran. See LICENSE for details.
|
49
|
+
|
43
50
|
Copyright (c) 2016 Mike Polischuk. See LICENSE for details.
|
data/ruby_bosh.gemspec
CHANGED