connect-proxy

Connect method style of HTTP tunnelling / HTTP proxy
1.4.1 Latest release released

Connect Proxy

CI

A simple implementation of the connect method for HTTP tunnelling. Most commonly used in HTTP proxy servers.

Usage

The most common usage of this shard is to use the crystal ::HTTP::Client via a proxy server

host = URI.parse("https://www.google.com")
response = ConnectProxy::HTTPClient.new(host) do |client|
  client.exec("GET", "/")
end
response.success?

By default the HTTP client will pick up the https_proxy or http_proxy environment variables and use the URLs configured in there. However you can override the environment or provide your own proxy server.

host = URI.parse("https://www.google.com")
client = ConnectProxy::HTTPClient.new(host)
proxy = ConnectProxy.new("134.209.219.234", 80, {username: "admin", password: "pass"})
client.set_proxy(proxy)
response = client.exec("GET", "/")
response.success?
connect-proxy:
  github: spider-gazelle/connect-proxy
  version: ~> 1.4.1
License MIT
Crystal >= 0.36.1

Libraries 1

  • libssl: >= 1.0.2

Dependencies 0

Development Dependencies 1

  • ameba
    {'github' => 'veelenga/ameba'}
Last synced .
search fire star recently