Popularity
2.7
Declining
Activity
3.9
Growing
2
3
0

Programming language: Crystal
Tags: Network Protocols    
Latest version: v1.0.0

connect-proxy alternatives and similar shards

Based on the "Network Protocols" category

Do you think we are missing an alternative of connect-proxy or a related project?

Add another 'Network Protocols' Shard

README

Connect Proxy

Build Status

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?