garufa 1.0.0.rc.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f7b4a234feb8611e70d7c76e2ad254c97049ad5
4
- data.tar.gz: a790c9505d6e62412d0093c91c7c261ae90622e5
3
+ metadata.gz: feb8e6e2251eca7ffa865791866ced7d91434c87
4
+ data.tar.gz: 306edcf627d01d05336297f9db7e4b8b241abfdb
5
5
  SHA512:
6
- metadata.gz: 5ccd62ac3a46148dc0991687abbd5563d0095422b36f4ec071ff13c58ac4d15f67957cc0053c8f068c856c6a839abb48e59786b6adb82bd751365af50417ed62
7
- data.tar.gz: d6210ef3d2868ab44275e63123165e6a8e6797c3564cfed0b611cf3564ec30358ce084fdd11c40cbfd8f8c23e1f36f264d1090c2c57e1f8a69069cb73d05e887
6
+ metadata.gz: 9655597ace7f0e79e59832e4b4ffa6644fa3d64409d4e82c992ddc46e1fb1088d9992346ea4ab746ca01854a6def3cc488bed4af6695a2e28e34cba545bbeb96
7
+ data.tar.gz: 398b5e33ff82a0b8fef3bfe06ec35e9642120733beee835ac02344bb17bb40b49b65ef3347587dcab8c2a8f3a9043a39106a83ba0d175d72337b3fcc7f2ee724
data/README.md CHANGED
@@ -6,10 +6,6 @@ Garufa
6
6
 
7
7
  An open source server implementation of the [Pusher][pusher] protocol.
8
8
 
9
- **IMPORTANT:** Garufa is currently in beta version, which means it is not
10
- production ready, but you are free to use it and test it. Any feedback is
11
- welcome.
12
-
13
9
  Intro
14
10
  -----
15
11
 
@@ -23,7 +19,7 @@ Install
23
19
  Be sure you have a ruby version >= 1.9.2
24
20
 
25
21
  ``` console
26
- $ gem install garufa --pre
22
+ $ gem install garufa
27
23
 
28
24
  $ garufa --help
29
25
  ```
@@ -89,13 +85,60 @@ SSL support
89
85
  -----------
90
86
 
91
87
  ``` console
92
- $ garufa -sv --app_key app-key --secret app-secret --ssl --ssl-cert /path/to/cert.pem --ssl-key /path/to/key.key
88
+ $ garufa -sv --app_key app-key --secret app-secret --ssl --ssl-cert /path/to/cert.pem --ssl-key /path/to/cert.key
93
89
  ```
94
90
 
95
91
  **NOTE**: At the moment, Garufa uses the same port for API messages and websocket
96
- connections. This means that if you start the server with ssl enabled, you will
97
- have to enable ssl in the client library as well as in the api client.
92
+ connections. This means that if you start the server with SSL enabled, you will
93
+ have to enable SSL in the client library as well as in the api client.
94
+
95
+ An alternative is to setup Garufa behind a reverse proxy such as Nginx and let the
96
+ proxy take care of SSL. See below for more info.
97
+
98
+
99
+ Using Nginx as reverse proxy
100
+ ----------------------
101
+
102
+ You can set Garufa behind Nginx if you want: http://nginx.org/en/docs/http/websocket.html
98
103
 
104
+ Take into account that you will need to set *proxy_read_timeout* to a value a little
105
+ higher than Pusher *ACTIVITY_TIMEOUT*, otherwise Nginx will close the connection.
106
+
107
+ In addition, you can let Ngnix take care of SSL and start Garufa without SSL enabled.
108
+ You could use something like this in your Nginx configuration.
109
+
110
+ ```
111
+ upstream garufa {
112
+ server 127.0.0.1:8000;
113
+ }
114
+
115
+ map $http_upgrade $connection_upgrade {
116
+ default upgrade;
117
+ '' close;
118
+ }
119
+
120
+ server {
121
+ listen 8080;
122
+ server_name garufa.example.com;
123
+
124
+ ; Set this a little higher than Pusher ACTIVITY_TIMEOUT
125
+ proxy_read_timeout 150;
126
+
127
+ ssl on;
128
+ ssl_certificate /path/to/cert.pem;
129
+ ssl_certificate_key /path/to/cert.key;
130
+ ssl_session_timeout 5m;
131
+ ssl_ciphers HIGH:!aNULL:!MD5;
132
+ ssl_prefer_server_ciphers on;
133
+
134
+ location / {
135
+ proxy_pass http://garufa;
136
+ proxy_http_version 1.1;
137
+ proxy_set_header Upgrade $http_upgrade;
138
+ proxy_set_header Connection $connection_upgrade;
139
+ }
140
+ }
141
+ ```
99
142
 
100
143
  Testing and Contributing
101
144
  ------------------------
@@ -111,8 +154,7 @@ $ bundle init --gemspec=garufa.gemspec
111
154
  $ bundle install
112
155
  ```
113
156
 
114
- Once you have dependencies installed, just run *rake test*, or just *rake*, as
115
- *test* is the default task.
157
+ Once you have dependencies installed, run *rake test* (or just *rake*).
116
158
 
117
159
  ``` console
118
160
  $ rake
data/bin/garufa.pid CHANGED
@@ -1 +1 @@
1
- 17188
1
+ 11421
data/garufa.gemspec CHANGED
@@ -11,9 +11,9 @@ Gem::Specification.new do |s|
11
11
  s.authors = ["Juan Manuel Cuello"]
12
12
  s.email = ["juanmacuello@gmail.com"]
13
13
  s.homepage = "http://github.com/Juanmcuello/garufa"
14
- s.bindir = 'bin'
15
- s.executables << 'garufa'
16
- s.required_ruby_version = '>=1.9'
14
+ s.bindir = "bin"
15
+ s.executables << "garufa"
16
+ s.required_ruby_version = ">=1.9"
17
17
 
18
18
  s.files = Dir[
19
19
  "LICENSE",
@@ -25,10 +25,10 @@ Gem::Specification.new do |s|
25
25
  "test/*.*"
26
26
  ]
27
27
 
28
- s.add_dependency "goliath"
29
- s.add_dependency "faye-websocket", '~> 0.7.2'
30
- s.add_dependency "cuba"
31
- s.add_dependency "signature"
32
- s.add_development_dependency "rake"
33
- s.add_development_dependency "minitest", '~> 5.3.1'
28
+ s.add_dependency "goliath", "1.0.3"
29
+ s.add_dependency "faye-websocket", "0.7.2"
30
+ s.add_dependency "cuba", "3.1.1"
31
+ s.add_dependency "signature", "0.1.7"
32
+ s.add_development_dependency "rake", "10.1.0"
33
+ s.add_development_dependency "minitest", "5.3.1"
34
34
  end
@@ -1,4 +1,4 @@
1
1
  module Garufa
2
- VERSION = '1.0.0.rc.1'
2
+ VERSION = '1.0.0'
3
3
  end
4
4
 
data/test/connection.rb CHANGED
@@ -25,13 +25,14 @@ module Garufa
25
25
 
26
26
  describe 'pusher:subscribe' do
27
27
 
28
- let(:data) { { event: 'pusher:subscribe', data: { channel: 'ch1' } } }
28
+ let(:channel) { 'ch1' }
29
+ let(:data) { { event: 'pusher:subscribe', data: { channel: channel } } }
29
30
 
30
31
  it 'should add a new Subscription to Subscriptions' do
32
+ count = Subscriptions.all[channel].count
31
33
  @socket.expect :send, true, [String]
32
34
  @connection.handle_incomming_data data.to_json
33
- Subscriptions.all['ch1'].first.class.must_equal Subscription
34
- Subscriptions.all['ch1'].count.must_equal 1
35
+ Subscriptions.all[channel].count.must_equal count + 1
35
36
  end
36
37
 
37
38
  describe 'public channels' do
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garufa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Manuel Cuello
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-11 00:00:00.000000000 Z
11
+ date: 2014-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: goliath
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 1.0.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 1.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faye-websocket
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.7.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.7.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cuba
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 3.1.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 3.1.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: signature
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.1.7
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 0.1.7
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 10.1.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 10.1.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: minitest
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
89
  version: 5.3.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
96
  version: 5.3.1
97
97
  description: Garufa is a websocket server compatible with the Pusher protocol.
@@ -105,26 +105,26 @@ files:
105
105
  - LICENSE
106
106
  - README.md
107
107
  - Rakefile
108
- - lib/garufa/version.rb
109
- - lib/garufa/goliath/connection.rb
108
+ - bin/garufa
109
+ - bin/garufa.pid
110
+ - garufa.gemspec
111
+ - lib/garufa.rb
110
112
  - lib/garufa/api/api.rb
111
113
  - lib/garufa/api/handler.rb
112
- - lib/garufa/subscription.rb
113
- - lib/garufa/websocket/websocket.rb
114
- - lib/garufa/message.rb
115
114
  - lib/garufa/config.rb
115
+ - lib/garufa/connection.rb
116
116
  - lib/garufa/cuba/authentication.rb
117
- - lib/garufa/subscriptions.rb
118
117
  - lib/garufa/garufa_app.rb
119
- - lib/garufa/connection.rb
120
- - lib/garufa.rb
121
- - bin/garufa.pid
122
- - bin/garufa
123
- - garufa.gemspec
118
+ - lib/garufa/goliath/connection.rb
119
+ - lib/garufa/message.rb
120
+ - lib/garufa/subscription.rb
121
+ - lib/garufa/subscriptions.rb
122
+ - lib/garufa/version.rb
123
+ - lib/garufa/websocket/websocket.rb
124
+ - test/connection.rb
124
125
  - test/helper.rb
125
126
  - test/message.rb
126
127
  - test/subscriptions.rb
127
- - test/connection.rb
128
128
  homepage: http://github.com/Juanmcuello/garufa
129
129
  licenses: []
130
130
  metadata: {}
@@ -134,19 +134,18 @@ require_paths:
134
134
  - lib
135
135
  required_ruby_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - '>='
137
+ - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '1.9'
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - '>'
142
+ - - ">="
143
143
  - !ruby/object:Gem::Version
144
- version: 1.3.1
144
+ version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.0.3
147
+ rubygems_version: 2.2.2
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Websocket server compatible with Pusher.
151
151
  test_files: []
152
- has_rdoc: