iodine 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of iodine might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +0 -6
- data/lib/iodine/http/request.rb +5 -0
- data/lib/iodine/http/websocket_handler.rb +13 -2
- data/lib/iodine/protocol.rb +1 -1
- data/lib/iodine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7911b148c188d1f152a742917c38f4f0e6842cd
|
4
|
+
data.tar.gz: 2b1f3862c8c952d5e81e6f7ab216e048086c1bbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d0143b7066b7d511e628d33bd5d1f2b098238f883b2a68339ed557344f967eac671ed4f18eb7a7f81851a8c3a5ea6fbbe93bede310420fe640210de090edf4
|
7
|
+
data.tar.gz: 49f1992df2719f383bbe478efa4bf33be3932dbeca3b06d866a876ba94b00ada59241a08c31fb9522a4d4d361036fdc59284df60961b7095fd24a9fb4980070b
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,12 @@ Please notice that this change log contains changes for upcoming releases as wel
|
|
8
8
|
|
9
9
|
***
|
10
10
|
|
11
|
+
Change log v.0.1.18
|
12
|
+
|
13
|
+
**Update**: The request now has the shortcut method `Request#host_name` for accessing the host's name (without the port part of the string).
|
14
|
+
|
15
|
+
***
|
16
|
+
|
11
17
|
Change log v.0.1.17
|
12
18
|
|
13
19
|
**Credit**: thanks you @frozenfoxx for going through the readme and fixing my broken grammer.
|
data/README.md
CHANGED
@@ -262,12 +262,6 @@ For instance, in Iodine's implementation for the Websocket protocol: Websocket m
|
|
262
262
|
|
263
263
|
The exception to the rule is the `ping` implementation. Your protocol's `ping` method will execute in parallel with other parts of your protocol's code. Pinging is a machanism that is often time sensitive and is required to maintain an open connection. For this reason, if your code is working hard on a long task, a ping will still occure automatically in the background and offset any connection timeout.
|
264
264
|
|
265
|
-
## Development
|
266
|
-
|
267
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
268
|
-
|
269
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
270
|
-
|
271
265
|
## Contributing
|
272
266
|
|
273
267
|
Bug reports and pull requests are welcome on GitHub at https://github.com/boazsegev/iodine.
|
data/lib/iodine/http/request.rb
CHANGED
@@ -111,6 +111,11 @@ module Iodine
|
|
111
111
|
self[:scheme]
|
112
112
|
end
|
113
113
|
|
114
|
+
# the host's name (without the port)
|
115
|
+
def host_name
|
116
|
+
self[:host_name]
|
117
|
+
end
|
118
|
+
|
114
119
|
# @return [true, false] returns true if the requested was an SSL protocol (true also if the connection is clear-text behind an SSL Proxy, such as with some PaaS providers).
|
115
120
|
def ssl?
|
116
121
|
self[:io].ssl? || self[:scheme] == 'https'.freeze || self[:scheme] == 'wss'.freeze
|
@@ -11,7 +11,18 @@ module Iodine
|
|
11
11
|
attr_reader :request
|
12
12
|
# The Http response, also allowing for websocket data
|
13
13
|
attr_reader :response
|
14
|
-
# this
|
14
|
+
# this shoulw be called while still communicating over Http,
|
15
|
+
# as part of the "upgrade" process. The new object should be returned by the {Iodine::Http#on_websocket} handler.
|
16
|
+
#
|
17
|
+
# i.e.:
|
18
|
+
#
|
19
|
+
# Iodine::Http.on_websocket do |request, response|
|
20
|
+
# next if request.path =~ /refuse/
|
21
|
+
# Iodine::Http::WebsocketHandler.new request, response
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
#
|
25
|
+
# see also the {WebsocketHandler.call} method for an example.
|
15
26
|
def initialize request, response
|
16
27
|
@request = request
|
17
28
|
@response = response
|
@@ -37,7 +48,7 @@ module Iodine
|
|
37
48
|
def on_shutdown
|
38
49
|
end
|
39
50
|
|
40
|
-
# This method allows the class itself to act as the Websocket handler,
|
51
|
+
# This method allows the class itself to act as the global Websocket handler, accepting websocket connections. Example use:
|
41
52
|
#
|
42
53
|
# # Iodine::Http::WebsocketHandler's default implementation does nothing.
|
43
54
|
# Iodine::Http.on_websocket Iodine::Http::WebsocketHandler
|
data/lib/iodine/protocol.rb
CHANGED
@@ -48,7 +48,7 @@ module Iodine
|
|
48
48
|
# the value is usually `nil` unless the protocol instance was created by a different protocol while "upgrading" from one protocol to the next.
|
49
49
|
attr_reader :options
|
50
50
|
# The protocol's Mutex locker. It should be locked whenever your code is runing, unless you are
|
51
|
-
# writing
|
51
|
+
# writing asynchronous code.
|
52
52
|
#
|
53
53
|
# Use with care (or, better yet, don't use).
|
54
54
|
attr_reader :locker
|
data/lib/iodine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iodine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|