amf_socket 0.3.0 → 0.3.1
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/Gemfile.lock +3 -3
- data/README.md +15 -0
- data/amf_socket.gemspec +1 -1
- data/lib/amf_socket.rb +1 -0
- data/lib/amf_socket/policy_connection.rb +16 -0
- data/lib/amf_socket/version.rb +1 -1
- metadata +7 -6
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
amf_socket (0.3.
|
4
|
+
amf_socket (0.3.1)
|
5
5
|
RocketAMF (>= 0.2.1)
|
6
|
-
eventmachine (>= 0.
|
6
|
+
eventmachine (>= 1.0.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
debugger-ruby_core_source (>= 1.1.1)
|
19
19
|
debugger-ruby_core_source (1.1.3)
|
20
20
|
diff-lcs (1.1.3)
|
21
|
-
eventmachine (0.
|
21
|
+
eventmachine (1.0.0)
|
22
22
|
ffi (1.1.5)
|
23
23
|
growl (1.0.3)
|
24
24
|
guard (1.3.2)
|
data/README.md
CHANGED
@@ -18,6 +18,8 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
+
require 'amf_socket'
|
22
|
+
|
21
23
|
EM.run do
|
22
24
|
class MyConnection < AmfSocket::AmfRpcConnection
|
23
25
|
def post_init
|
@@ -59,6 +61,19 @@ Or install it yourself as:
|
|
59
61
|
EM.start_server('localhost', 9000, MyConnection)
|
60
62
|
end
|
61
63
|
|
64
|
+
## Policy Server
|
65
|
+
|
66
|
+
Newer versions of the Flash runtime require a valid policy file before socket connections are permitted.
|
67
|
+
This gem includes a simple policy connection class for delivering this file.
|
68
|
+
Note that you will need run the below code as root on Linux/UNIX since it uses a port number less 1024.
|
69
|
+
It is recommended you run the policy server in a separate process from your application code in order to minimize security risks.
|
70
|
+
|
71
|
+
require 'amf_socket'
|
72
|
+
|
73
|
+
EM.run do
|
74
|
+
EM.start_server('0.0.0.0', 843, AmfSocket::PolicyConnection)
|
75
|
+
end
|
76
|
+
|
62
77
|
## Contributing
|
63
78
|
|
64
79
|
1. Fork it
|
data/amf_socket.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = AmfSocket::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency('eventmachine', ['>= 0.
|
18
|
+
gem.add_dependency('eventmachine', ['>= 1.0.0'])
|
19
19
|
gem.add_dependency('RocketAMF', ['>= 0.2.1'])
|
20
20
|
|
21
21
|
gem.add_development_dependency('rake', ['= 0.9.2.2'])
|
data/lib/amf_socket.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
class AmfSocket::PolicyConnection < EM::Connection
|
2
|
+
def post_init
|
3
|
+
policy = <<-eos
|
4
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
5
|
+
<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFileSocket.xsd">
|
6
|
+
<allow-access-from domain="*" to-ports="*"/>
|
7
|
+
</cross-domain-policy>
|
8
|
+
eos
|
9
|
+
|
10
|
+
send_data(policy)
|
11
|
+
close_connection_after_writing
|
12
|
+
end
|
13
|
+
|
14
|
+
def receive_data(data)
|
15
|
+
end
|
16
|
+
end
|
data/lib/amf_socket/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amf_socket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09
|
12
|
+
date: 2012-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 1.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 1.0.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: RocketAMF
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- lib/amf_socket/amf_rpc_connection.rb
|
161
161
|
- lib/amf_socket/exceptions.rb
|
162
162
|
- lib/amf_socket/heartbeat.rb
|
163
|
+
- lib/amf_socket/policy_connection.rb
|
163
164
|
- lib/amf_socket/rpc_message.rb
|
164
165
|
- lib/amf_socket/rpc_received_message.rb
|
165
166
|
- lib/amf_socket/rpc_received_request.rb
|
@@ -192,7 +193,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
193
|
version: '0'
|
193
194
|
segments:
|
194
195
|
- 0
|
195
|
-
hash: -
|
196
|
+
hash: -2672037425952662706
|
196
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
198
|
none: false
|
198
199
|
requirements:
|
@@ -201,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
202
|
version: '0'
|
202
203
|
segments:
|
203
204
|
- 0
|
204
|
-
hash: -
|
205
|
+
hash: -2672037425952662706
|
205
206
|
requirements: []
|
206
207
|
rubyforge_project:
|
207
208
|
rubygems_version: 1.8.24
|