Project

General

Profile

Feature #5460 ยป http.rb.patch

nazy (Hiroki Najima), 10/18/2011 06:20 PM

View differences:

http.rb Tue Oct 18 14:16:35 2011
if use_ssl?
begin
if proxy?
@socket.writeline sprintf('CONNECT %s:%s HTTP/%s',
buf = sprintf("CONNECT %s:%s HTTP/%s\r\n",
@address, @port, HTTPVersion)
@socket.writeline "Host: #{@address}:#{@port}"
buf << "Host: #{@address}:#{@port}\r\n"
if proxy_user
credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
credential.delete!("\r\n")
@socket.writeline "Proxy-Authorization: Basic #{credential}"
buf << "Proxy-Authorization: Basic #{credential}\r\n"
end
@socket.writeline ''
buf << "\r\n"
@socket.write(buf)
HTTPResponse.read_new(@socket).value
end
timeout(@open_timeout) { s.connect }
    (1-1/1)