fluent-plugin-websocket 0.1.2 → 0.1.3
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.
- data/{README.md → README.rdoc} +26 -21
- data/fluent-plugin-websocket.gemspec +3 -3
- metadata +5 -4
data/{README.md → README.rdoc}
RENAMED
@@ -1,17 +1,18 @@
|
|
1
|
-
|
1
|
+
= Fluent::Plugin::Websocket
|
2
2
|
|
3
3
|
Fluentd websocket output plugin.
|
4
4
|
|
5
|
-
|
5
|
+
This plugin works as websocket server which can output JSON string or {MessagePack}[http://msgpack.org/] binary.
|
6
6
|
|
7
|
-
|
7
|
+
In the current version, emitted data will be broadcasted to the all connected clients.
|
8
8
|
|
9
|
-
|
9
|
+
== Installation
|
10
10
|
|
11
|
-
|
11
|
+
gem install fluent-plugin-websocket
|
12
12
|
|
13
|
+
This plugin depends on {*em-websocket*}[https://github.com/igrigorik/em-websocket].
|
13
14
|
|
14
|
-
|
15
|
+
== Configuration
|
15
16
|
<match foo.**>
|
16
17
|
type websocket
|
17
18
|
host 192.168.1.1 # default: 0.0.0.0 (ANY)
|
@@ -21,13 +22,13 @@ This plugin depends on [__em-websocket__](https://github.com/igrigorik/em-websoc
|
|
21
22
|
add_tag true # default: true
|
22
23
|
</match>
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
* *host*: WebSocket server IP address.
|
26
|
+
* *port*: WebSocket server port.
|
27
|
+
* <b>use_msgpack</b>: Send {MessagePack}[http://msgpack.org/] format binary. Otherwise, you send JSON format text.
|
28
|
+
* <b>add_time</b>: Add timestamp to the data.
|
29
|
+
* <b>add_tag</b>: Add fluentd tag to the data.
|
29
30
|
|
30
|
-
If there are no websocket connections, this plugin silently discards data. You may use
|
31
|
+
If there are no websocket connections, this plugin silently discards data. You may use <em>out_copy</em> plugin like this:
|
31
32
|
|
32
33
|
<match foo.**>
|
33
34
|
type copy
|
@@ -41,26 +42,26 @@ If there are no websocket connections, this plugin silently discards data. You m
|
|
41
42
|
</store>
|
42
43
|
</match>
|
43
44
|
|
44
|
-
|
45
|
+
== Data format
|
45
46
|
[tag, timestamp, data_object]
|
46
47
|
|
47
|
-
|
48
|
-
|
48
|
+
* tag is appended when <em>add_tag</em> option is true.
|
49
|
+
* timespamp is appended when <em>add_time</em> option is true.
|
49
50
|
|
50
|
-
|
51
|
+
=== Example
|
51
52
|
curl -X POST -d 'json={"action":"login","user":6}' http://localhost:8888/foo/bar
|
52
53
|
|
53
54
|
["foo.bar",1364699026,{"action":"login","user":6}]
|
54
55
|
|
55
|
-
|
56
|
-
|
56
|
+
== Client sample
|
57
|
+
=== JSON format (use_msgpack: false)
|
57
58
|
function onMessage(evt) {
|
58
59
|
data = JSON.parse(evt.data);
|
59
60
|
...
|
60
61
|
}
|
61
62
|
|
62
|
-
|
63
|
-
Extract data by
|
63
|
+
=== Msgpack format binary (use_msgpack: true)
|
64
|
+
Extract data by {msgpack.js}[https://github.com/msgpack/msgpack-javascript].
|
64
65
|
|
65
66
|
websocket.binaryType = "arraybuffer"
|
66
67
|
...
|
@@ -69,7 +70,7 @@ Extract data by [msgpack.js](https://github.com/msgpack/msgpack-javascript).
|
|
69
70
|
...
|
70
71
|
}
|
71
72
|
|
72
|
-
|
73
|
+
== Contributing
|
73
74
|
|
74
75
|
1. Fork it
|
75
76
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
@@ -77,3 +78,7 @@ Extract data by [msgpack.js](https://github.com/msgpack/msgpack-javascript).
|
|
77
78
|
4. Push to the branch (`git push origin my-new-feature`)
|
78
79
|
5. Create new Pull Request
|
79
80
|
|
81
|
+
== Copyright
|
82
|
+
|
83
|
+
Copyright:: Copyright (c) 2013 IZAWA Tetsu (@moccos)
|
84
|
+
License:: Apache License, Version 2.0
|
@@ -3,12 +3,12 @@ lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "fluent-plugin-websocket"
|
6
|
-
gem.version = "0.1.
|
6
|
+
gem.version = "0.1.3"
|
7
7
|
gem.authors = ["IZAWA Tetsu (@moccos)"]
|
8
8
|
gem.email = ["tt.izawa@gmail.com"]
|
9
9
|
gem.homepage = "https://github.com/moccos/fluent-plugin-websocket"
|
10
10
|
gem.summary = %q{Fluentd websocket output plugin}
|
11
|
-
gem.description = %q{Fluentd websocket output plugin}
|
11
|
+
gem.description = %q{Fluentd websocket output plugin which can output JSON string or MessagePack binary to the clients.}
|
12
12
|
gem.required_ruby_version = ">= 1.9.2"
|
13
13
|
|
14
14
|
gem.files = `git ls-files`.split($/)
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
|
19
19
|
gem.add_development_dependency "rake"
|
20
20
|
gem.add_development_dependency "fluentd"
|
21
|
-
gem.add_development_dependency "websocket-
|
21
|
+
gem.add_development_dependency "websocket-eventmachine-client"
|
22
22
|
gem.add_development_dependency "msgpack"
|
23
23
|
gem.add_runtime_dependency "fluentd"
|
24
24
|
gem.add_runtime_dependency "em-websocket"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name: websocket-
|
47
|
+
name: websocket-eventmachine-client
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
@@ -107,7 +107,8 @@ dependencies:
|
|
107
107
|
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
|
-
description: Fluentd websocket output plugin
|
110
|
+
description: Fluentd websocket output plugin which can output JSON string or MessagePack
|
111
|
+
binary to the clients.
|
111
112
|
email:
|
112
113
|
- tt.izawa@gmail.com
|
113
114
|
executables: []
|
@@ -117,7 +118,7 @@ files:
|
|
117
118
|
- .gitignore
|
118
119
|
- Gemfile
|
119
120
|
- LICENSE.txt
|
120
|
-
- README.
|
121
|
+
- README.rdoc
|
121
122
|
- Rakefile
|
122
123
|
- fluent-plugin-websocket.gemspec
|
123
124
|
- lib/fluent/plugin/out_websocket.rb
|