websocket-driver 0.1.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/README.md +266 -0
- data/ext/websocket_mask/WebsocketMaskService.java +61 -0
- data/ext/websocket_mask/extconf.rb +5 -0
- data/ext/websocket_mask/websocket_mask.c +33 -0
- data/lib/websocket/driver.rb +158 -0
- data/lib/websocket/driver/client.rb +117 -0
- data/lib/websocket/driver/draft75.rb +93 -0
- data/lib/websocket/driver/draft76.rb +97 -0
- data/lib/websocket/driver/event_emitter.rb +43 -0
- data/lib/websocket/driver/hybi.rb +368 -0
- data/lib/websocket/driver/hybi/stream_reader.rb +30 -0
- data/lib/websocket/driver/utf8_match.rb +7 -0
- data/lib/websocket_mask.jar +0 -0
- metadata +101 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
module WebSocket
|
2
|
+
class Driver
|
3
|
+
|
4
|
+
class Hybi
|
5
|
+
class StreamReader
|
6
|
+
def initialize
|
7
|
+
@queue = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def read(length)
|
11
|
+
read_bytes(length)
|
12
|
+
end
|
13
|
+
|
14
|
+
def put(bytes)
|
15
|
+
return unless bytes and bytes.size > 0
|
16
|
+
@queue.concat(bytes)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def read_bytes(length)
|
22
|
+
return nil if length > @queue.size
|
23
|
+
@queue.shift(length)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
module WebSocket
|
2
|
+
class Driver
|
3
|
+
# http://www.w3.org/International/questions/qa-forms-utf-8.en.php
|
4
|
+
UTF8_MATCH = /^([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$/
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: websocket-driver
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: java
|
7
|
+
authors:
|
8
|
+
- James Coglan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-05-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake-compiler
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: !binary |-
|
21
|
+
MA==
|
22
|
+
none: false
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: !binary |-
|
28
|
+
MA==
|
29
|
+
none: false
|
30
|
+
prerelease: false
|
31
|
+
type: :development
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: rspec
|
34
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: !binary |-
|
39
|
+
MA==
|
40
|
+
none: false
|
41
|
+
requirement: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: !binary |-
|
46
|
+
MA==
|
47
|
+
none: false
|
48
|
+
prerelease: false
|
49
|
+
type: :development
|
50
|
+
description:
|
51
|
+
email: jcoglan@gmail.com
|
52
|
+
executables: []
|
53
|
+
extensions: []
|
54
|
+
extra_rdoc_files:
|
55
|
+
- README.md
|
56
|
+
files:
|
57
|
+
- README.md
|
58
|
+
- CHANGELOG.md
|
59
|
+
- ext/websocket_mask/websocket_mask.c
|
60
|
+
- ext/websocket_mask/WebsocketMaskService.java
|
61
|
+
- ext/websocket_mask/extconf.rb
|
62
|
+
- lib/websocket/driver.rb
|
63
|
+
- lib/websocket/driver/client.rb
|
64
|
+
- lib/websocket/driver/draft75.rb
|
65
|
+
- lib/websocket/driver/draft76.rb
|
66
|
+
- lib/websocket/driver/event_emitter.rb
|
67
|
+
- lib/websocket/driver/hybi.rb
|
68
|
+
- lib/websocket/driver/utf8_match.rb
|
69
|
+
- lib/websocket/driver/hybi/stream_reader.rb
|
70
|
+
- lib/websocket_mask.jar
|
71
|
+
homepage: http://github.com/faye/websocket-driver-ruby
|
72
|
+
licenses: []
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options:
|
75
|
+
- "--main"
|
76
|
+
- README.md
|
77
|
+
- "--markup"
|
78
|
+
- markdown
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: !binary |-
|
86
|
+
MA==
|
87
|
+
none: false
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: !binary |-
|
93
|
+
MA==
|
94
|
+
none: false
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 1.8.24
|
98
|
+
signing_key:
|
99
|
+
specification_version: 3
|
100
|
+
summary: WebSocket protocol handler with pluggable I/O
|
101
|
+
test_files: []
|