rev-websocket 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog ADDED
@@ -0,0 +1,9 @@
1
+
2
+ 2010-07-13 version 0.1.1:
3
+
4
+ * fixes compatibility with Chrome 6 (draft-76)
5
+
6
+ 2010-07-13 version 0.1.0:
7
+
8
+ * first release
9
+
data/README.rdoc CHANGED
@@ -8,7 +8,7 @@ This library conforms to WebSocket draft-75 and draft-76.
8
8
  - http://github.com/frsyuki/rev-websocket
9
9
 
10
10
 
11
- == Simple example
11
+ == Installation
12
12
 
13
13
  gem install rev-websocket
14
14
 
@@ -35,12 +35,12 @@ This library conforms to WebSocket draft-75 and draft-76.
35
35
  end
36
36
 
37
37
  host = '0.0.0.0'
38
- port = '8081'
38
+ port = '8080'
39
39
 
40
40
  server = Rev::WebSocketServer.new(host, port, MyConnection)
41
41
  server.attach(Rev::Loop.default)
42
42
 
43
- Rev::Loop.run
43
+ Rev::Loop.default.run
44
44
 
45
45
 
46
46
  == Learn more
@@ -49,6 +49,7 @@ This library conforms to WebSocket draft-75 and draft-76.
49
49
  - [JSON for object serialization] http://github.com/brianmario/yajl-ruby
50
50
  - [MessagePack for object serialization] http://msgpack.org/
51
51
  - [The WebSocket protocol draft-76] http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
52
+ - [EventMachine based WebSocket server] http://github.com/igrigorik/em-websocket
52
53
 
53
54
 
54
55
  == License
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/lib/rev/websocket.rb CHANGED
@@ -87,7 +87,7 @@ module Rev
87
87
 
88
88
  return false unless @http11.finished?
89
89
 
90
- @data.read(@http11_nbytes)
90
+ @data.read(@http11_nbytes-1)
91
91
  remove_instance_variable(:@http11)
92
92
  remove_instance_variable(:@http11_nbytes)
93
93
 
@@ -118,7 +118,10 @@ module Rev
118
118
 
119
119
  rescue
120
120
  on_bad_request
121
+ return false
121
122
  end
123
+
124
+ return true
122
125
  end
123
126
 
124
127
  def on_bad_request
@@ -33,12 +33,7 @@ module Rev
33
33
  end
34
34
 
35
35
  def process_challenge_response
36
- return false if @data.size < 10
37
-
38
- crln = @data.read(2) # read \r\n bytes
39
- if crln != "\r\n"
40
- raise RuntimeError, "invalid request"
41
- end
36
+ return false if @data.size < 8
42
37
 
43
38
  key_3 = @data.read(8)
44
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rev-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - FURUHASHI Sadayuki
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-07-12 00:00:00 +09:00
12
+ date: 2010-07-13 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -39,9 +39,11 @@ executables: []
39
39
  extensions: []
40
40
 
41
41
  extra_rdoc_files:
42
+ - ChangeLog
42
43
  - README.rdoc
43
44
  files:
44
45
  - .gitignore
46
+ - ChangeLog
45
47
  - README.rdoc
46
48
  - Rakefile
47
49
  - VERSION