26 def self.uri_option(uri, config)
30 def self.open(uri, config)
31 unless /^http:/ =~ uri
32 raise(DRbBadScheme, uri) unless uri =~ /^http:/
33 raise(DRbBadURI, 'can\'t parse uri:' + uri)
35 ClientSide.new(uri, config)
39 def initialize(uri, config)
43 @msg = DRbMessage.new(config)
44 @proxy = ENV['HTTP_PROXY']
48 def alive?; false; end
50 def send_request(ref, msg_id, *arg, &b)
51 stream = StrStream.new
52 @msg.send_request(stream, ref, msg_id, *arg, &b)
53 @reply_stream = StrStream.new
54 post(@uri, stream.buf)
58 @msg.recv_reply(@reply_stream)
63 path = [(it.path=='' ? '/' : it.path), it.query].compact.join('?')
64 http = Net::HTTP.new(it.host, it.port)
66 http.post(path, data, {'Content-Type'=>'application/octetstream;'}) do |str|
68 if @config[:load_limit] < sio.buf.size
69 raise TypeError, 'too large packet'
76 DRbProtocol.add_protocol(HTTP0)