hessian 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/hessian.rb +4 -3
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/hessian.rb
CHANGED
@@ -17,11 +17,12 @@ module Hessian
|
|
17
17
|
end
|
18
18
|
|
19
19
|
class HessianClient
|
20
|
-
attr_reader :host, :port, :path
|
21
|
-
def initialize(url)
|
20
|
+
attr_reader :host, :port, :path, :proxy
|
21
|
+
def initialize(url, proxy = {})
|
22
22
|
uri = URI.parse(url)
|
23
23
|
@host, @port, @path = uri.host, uri.port, uri.path
|
24
24
|
raise "Unsupported Hessian protocol: #{uri.scheme}" unless uri.scheme == "http"
|
25
|
+
@proxy = proxy
|
25
26
|
end
|
26
27
|
|
27
28
|
def method_missing(id, *args)
|
@@ -32,7 +33,7 @@ module Hessian
|
|
32
33
|
def invoke(method, args)
|
33
34
|
req = HessianWriter.new.write_call method, args
|
34
35
|
header = { 'Content-Type' => 'application/binary' }
|
35
|
-
Net::HTTP.start(@host, @port) do |http|
|
36
|
+
Net::HTTP.start(@host, @port, *@proxy.values_at(:host, :port, :user, :password)) do |http|
|
36
37
|
res = http.send_request('POST', @path, req, header)
|
37
38
|
HessianParser.new.parse_response res.body
|
38
39
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: hessian
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.5.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.5.1
|
7
|
+
date: 2006-02-06 00:00:00 +01:00
|
8
8
|
summary: A Ruby Hessian client.
|
9
9
|
require_paths:
|
10
10
|
- lib
|