Sha256: bea53dc663dda9b031610d4a793ad56ecf21b7337d22c0b1042d29aa91017e80

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

#!/usr/bin/env ruby

require 'net/http'
require 'pp'

host="blub.appswarm"
port="80"
proxy_host=nil
proxy_port=nil
request_method="GET"

path="/"
header=""

begin
http = Net::HTTP.new(host, port, proxy_host, proxy_port)
        http.start{
          case request_method
          when "GET"  then response = http.get(path, header)
          when "POST" then response = http.post(path, req.body || "", header)
          when "HEAD" then response = http.head(path, header)
          else
            raise HTTPStatus::MethodNotAllowed,
              "unsupported method `#{req.request_method}'."
          end
        }
        
        rescue Object=>e
        pp e,e.backtrace
        end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
appswarm-0.0.1 apps/global_web_proxy/proxy/dnstest.rb