From f5445e26591b1cbc06a024d2a568cc5aa18493f5 Mon Sep 17 00:00:00 2001 From: Vincent Ollivier Date: Wed, 14 Mar 2018 16:24:56 +0100 Subject: [PATCH 1/2] Add HTTP_PROXY env --- lib/algolia/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/algolia/client.rb b/lib/algolia/client.rb index 5e4afb4c..97f7f032 100644 --- a/lib/algolia/client.rb +++ b/lib/algolia/client.rb @@ -439,7 +439,7 @@ def delete(uri, type = :write, request_options = {}) def thread_local_hosts(read) thread_hosts_key = read ? "algolia_search_hosts_#{application_id}" : "algolia_hosts_#{application_id}" Thread.current[thread_hosts_key] ||= (read ? search_hosts : hosts).each_with_index.map do |host, i| - client = HTTPClient.new + client = HTTPClient.new(ENV["HTTP_PROXY"]) client.ssl_config.ssl_version = @ssl_version if @ssl && @ssl_version client.transparent_gzip_decompression = @gzip client.ssl_config.add_trust_ca File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'resources', 'ca-bundle.crt')) From 3e354cca912d17fc63518db799a1f8125f311b63 Mon Sep 17 00:00:00 2001 From: Vincent Ollivier Date: Wed, 14 Mar 2018 17:34:04 +0100 Subject: [PATCH 2/2] Add HTTP_PROXY to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 291e1c76..4b56e39a 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,8 @@ index.set_settings searchableAttributes: %w( ) ``` +**Note:** If you are behind a proxy, set `HTTP_PROXY` environment variable. + ## Search You can now search for contacts using `firstname`, `lastname`, `company`, etc. (even with typos):