Sha256: 02e0426b8f33b66ab5e36c123e52a1080ee199dc0226909ee4fcade6d46309cd
Contents?: true
Size: 637 Bytes
Versions: 1
Compression:
Stored size: 637 Bytes
Contents
require "net/http" require_relative "../proxy" module Proxifier class HTTPProxy < Proxy def do_proxify(socket, host, port) return if query_options["tunnel"] == "false" socket << "CONNECT #{host}:#{port} HTTP/1.1\r\n" socket << "Host: #{host}:#{port}\r\n" socket << "Proxy-Authorization: Basic #{["#{user}:#{password}"].pack("m").chomp}\r\n" if user socket << "User-Agent: #{user_agent}\r\n" if user_agent socket << "\r\n" buffer = Net::BufferedIO.new(socket) response = Net::HTTPResponse.read_new(buffer) response.error! unless response.is_a?(Net::HTTPOK) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
proxifier-fork-1.1.0 | lib/proxifier/proxies/http.rb |