| 57 | | |
| 58 | | response = nil |
| 59 | | http = http_class(@http_proxy).new(@uri.host, @uri.port) |
| 60 | | if @uri.scheme == 'https' |
| 61 | | http.use_ssl = true |
| 62 | | http.verify_mode = OpenSSL::SSL::VERIFY_NONE |
| | 57 | begin |
| | 58 | http = http_class(@http_proxy).new(@uri.host, @uri.port) |
| | 59 | if @uri.scheme == 'https' |
| | 60 | http.use_ssl = true |
| | 61 | http.verify_mode = OpenSSL::SSL::VERIFY_NONE |
| | 62 | end |
| | 63 | http.start do |
| | 64 | case method |
| | 65 | when 'GET' |
| | 66 | http.get(@uri.request_uri, request_header.update({'Host' => "#{@uri.host}:#{@uri.port}", |
| | 67 | 'x-ssb' => 'server-side-browser'})) |
| | 68 | when 'POST' |
| | 69 | http.post(@uri.request_uri, |
| | 70 | @post_params, |
| | 71 | request_header.update({'Host' => "#{@uri.host}:#{@uri.port}", |
| | 72 | 'Content-Type' => 'application/x-www-form-urlencoded', |
| | 73 | 'x-ssb' => 'server-side-browser' |
| | 74 | })) |
| | 75 | else |
| | 76 | nil |
| | 77 | end |
| | 78 | end |
| | 79 | rescue =>e |
| | 80 | e.to_s + '<hr />' + e.backtrace.to_s |
| 64 | | http.start do |
| 65 | | case method |
| 66 | | when 'GET' |
| 67 | | response = http.get(@uri.request_uri, request_header.update({'Host' => "#{@uri.host}:#{@uri.port}", |
| 68 | | 'x-ssb' => 'server-side-browser'})) |
| 69 | | when 'POST' |
| 70 | | response = http.post(@uri.request_uri, |
| 71 | | @post_params, |
| 72 | | request_header.update({'Host' => "#{@uri.host}:#{@uri.port}", |
| 73 | | 'Content-Type' => 'application/x-www-form-urlencoded', |
| 74 | | 'x-ssb' => 'server-side-browser' |
| 75 | | })) |
| 76 | | end |
| 77 | | end |
| 78 | | response |