{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/http-remoting/pulls/comments/70557048","id":70557048,"diff_hunk":"@@ -117,68 +135,129 @@ public static FeignClientFactory of(\n             Request.Options options,\n             String userAgent) {\n         return new FeignClientFactory(\n-                contract, encoder, decoder, errorDecoder, clientSupplier, backoffStrategy, options, userAgent);\n+                contract, encoder, decoder, errorDecoder, clientSupplier, backoffStrategy, options, userAgent,\n+                new EmptyProxyConfigurationProvider());\n+    }\n+\n+    /**\n+     * Returns a new instance using the specified contract/encoder/decoder/client when constructing clients.\n+     */\n+    public static FeignClientFactory of(\n+            Contract contract,\n+            Encoder encoder,\n+            Decoder decoder,\n+            ErrorDecoder errorDecoder,\n+            ClientSupplier clientSupplier,\n+            BackoffStrategy backoffStrategy,\n+            Request.Options options,\n+            String userAgent,\n+            ProxyConfigurationProvider proxyConfigurationProvider) {\n+        return new FeignClientFactory(\n+                contract, encoder, decoder, errorDecoder, clientSupplier, backoffStrategy, options, userAgent,\n+                proxyConfigurationProvider);\n+    }\n+\n+    /**\n+     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and {@link\n+     * okhttp3.OkHttpClient} wrapped in {@link feign.okhttp.OkHttpClient}.\n+     */\n+    public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, String uri, Class<T> type) {\n+        return createProxy(sslSocketFactory, uri, type, defaultProxyConfigurationProvider);\n     }\n \n     /**\n-     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and feign {@link\n-     * feign.Client.Default} HTTP client.\n+     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and {@link\n+     * okhttp3.OkHttpClient} wrapped in {@link feign.okhttp.OkHttpClient}.\n      */\n     public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, String uri, Class<T> type,\n             Request.Options requestOptions) {\n-        return Feign.builder()\n-                .contract(contract)\n-                .encoder(encoder)\n-                .decoder(decoder)\n-                .errorDecoder(errorDecoder)\n-                .client(clientSupplier.createClient(sslSocketFactory, userAgent))\n-                .options(requestOptions)\n-                .logger(new Slf4jLogger(FeignClients.class))\n-                .logLevel(Level.BASIC)\n-                .requestInterceptor(UserAgentInterceptor.of(userAgent))\n-                .target(type, uri);\n+        return createProxy(sslSocketFactory, uri, type, defaultProxyConfigurationProvider, requestOptions);\n     }\n \n     /**\n-     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and feign {@link\n-     * feign.Client.Default} HTTP client.\n+     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and {@link\n+     * okhttp3.OkHttpClient} wrapped in {@link feign.okhttp.OkHttpClient}.\n      */\n-    public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, String uri, Class<T> type) {\n-        return createProxy(sslSocketFactory, uri, type, options);\n+    public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, String uri, Class<T> type,\n+            ProxyConfigurationProvider proxyConfigurationProvider) {\n+        return createProxy(sslSocketFactory, uri, type, proxyConfigurationProvider, options);\n+    }\n+\n+    /**\n+     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and {@link\n+     * okhttp3.OkHttpClient} wrapped in {@link feign.okhttp.OkHttpClient}.\n+     */\n+    public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, String uri, Class<T> type,\n+            ProxyConfigurationProvider proxyConfigurationProvider, Request.Options requestOptions) {\n+        return createProxy(sslSocketFactory, ImmutableSet.of(uri), type, proxyConfigurationProvider, requestOptions);\n     }\n \n+    /**\n+     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and\n+     * {@link okhttp3.OkHttpClient} wrapped in {@link feign.okhttp.OkHttpClient}. A {@link FailoverFeignTarget}\n+     * is used to cycle through the given uris on failure if there's more than one uri.\n+     */\n+    public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, Set<String> uris, Class<T> type) {\n+        return createProxy(sslSocketFactory, uris, type, options);\n+    }\n \n     /**\n-     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and feign {@link\n-     * feign.Client.Default} HTTP client. A {@link FailoverFeignTarget} is used to cycle through the given uris on\n-     * failure.\n+     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, and {@link\n+     * okhttp3.OkHttpClient} wrapped in {@link feign.okhttp.OkHttpClient}. A {@link FailoverFeignTarget} is used\n+     * to cycle through the given uris on failure if there's more than one uri.\n      */\n     public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, Set<String> uris, Class<T> type,\n             Request.Options requestOptions) {\n-        FailoverFeignTarget<T> target = new FailoverFeignTarget<>(uris, type, backoffStrategy);\n-        Client client = clientSupplier.createClient(sslSocketFactory, userAgent);\n-        client = target.wrapClient(client);\n-        return Feign.builder()\n+        return createProxy(sslSocketFactory, uris, type, defaultProxyConfigurationProvider, requestOptions);\n+    }\n+\n+    /**\n+     * Constructs a dynamic proxy for the specified type, using the supplied SSL factory if is present, proxy\n+     * configuration provider, and {@link okhttp3.OkHttpClient} wrapped in {@link feign.okhttp.OkHttpClient}.\n+     * A {@link FailoverFeignTarget} is used to cycle through the given uris on failure if there's more than one uri.\n+     */\n+    public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, Set<String> uris, Class<T> type,","path":"http-clients/src/main/java/com/palantir/remoting/http/FeignClientFactory.java","position":192,"original_position":192,"commit_id":"06fb4d86888244f9936355100bd9c72b92e333ba","original_commit_id":"06fb4d86888244f9936355100bd9c72b92e333ba","user":{"login":"markelliot","id":685891,"avatar_url":"https://avatars.githubusercontent.com/u/685891?v=3","gravatar_id":"","url":"https://api.github.com/users/markelliot","html_url":"https://github.com/markelliot","followers_url":"https://api.github.com/users/markelliot/followers","following_url":"https://api.github.com/users/markelliot/following{/other_user}","gists_url":"https://api.github.com/users/markelliot/gists{/gist_id}","starred_url":"https://api.github.com/users/markelliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markelliot/subscriptions","organizations_url":"https://api.github.com/users/markelliot/orgs","repos_url":"https://api.github.com/users/markelliot/repos","events_url":"https://api.github.com/users/markelliot/events{/privacy}","received_events_url":"https://api.github.com/users/markelliot/received_events","type":"User","site_admin":false},"body":"Rob and I have been discussing at least hiding Feign from the API in this regardless. \n\nConjure gives us optionality for change, but isn't a golden ticket. Certainly things are simpler if we hide the impl details, though. \n","created_at":"2016-07-13T02:37:55Z","updated_at":"2016-07-13T02:37:55Z","html_url":"https://github.com/palantir/http-remoting/pull/158#discussion_r70557048","pull_request_url":"https://api.github.com/repos/palantir/http-remoting/pulls/158","_links":{"self":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/comments/70557048"},"html":{"href":"https://github.com/palantir/http-remoting/pull/158#discussion_r70557048"},"pull_request":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/http-remoting/pulls/158","id":77039348,"html_url":"https://github.com/palantir/http-remoting/pull/158","diff_url":"https://github.com/palantir/http-remoting/pull/158.diff","patch_url":"https://github.com/palantir/http-remoting/pull/158.patch","issue_url":"https://api.github.com/repos/palantir/http-remoting/issues/158","number":158,"state":"open","locked":false,"title":"Proxy support","user":{"login":"iamthomaspowell","id":18428827,"avatar_url":"https://avatars.githubusercontent.com/u/18428827?v=3","gravatar_id":"","url":"https://api.github.com/users/iamthomaspowell","html_url":"https://github.com/iamthomaspowell","followers_url":"https://api.github.com/users/iamthomaspowell/followers","following_url":"https://api.github.com/users/iamthomaspowell/following{/other_user}","gists_url":"https://api.github.com/users/iamthomaspowell/gists{/gist_id}","starred_url":"https://api.github.com/users/iamthomaspowell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamthomaspowell/subscriptions","organizations_url":"https://api.github.com/users/iamthomaspowell/orgs","repos_url":"https://api.github.com/users/iamthomaspowell/repos","events_url":"https://api.github.com/users/iamthomaspowell/events{/privacy}","received_events_url":"https://api.github.com/users/iamthomaspowell/received_events","type":"User","site_admin":false},"body":"Not ready for merging yet but aiming to get feedback on this a solution to providing proxy support to http-remoting. The main motivation for switching ProxyConfiguration to ProxyConfigurationProvider is so that we can easily setup a provider chain. If this is used in standalone libraries it should make it to use environment variables or JVM args to configure the proxy and minimize the amount of custom code required.","created_at":"2016-07-11T23:23:16Z","updated_at":"2016-07-13T02:37:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7eb8318994a44d5671a5c2ac5d123cd0511334e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/palantir/http-remoting/pulls/158/commits","review_comments_url":"https://api.github.com/repos/palantir/http-remoting/pulls/158/comments","review_comment_url":"https://api.github.com/repos/palantir/http-remoting/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/http-remoting/issues/158/comments","statuses_url":"https://api.github.com/repos/palantir/http-remoting/statuses/06fb4d86888244f9936355100bd9c72b92e333ba","head":{"label":"iamthomaspowell:proxy-support","ref":"proxy-support","sha":"06fb4d86888244f9936355100bd9c72b92e333ba","user":{"login":"iamthomaspowell","id":18428827,"avatar_url":"https://avatars.githubusercontent.com/u/18428827?v=3","gravatar_id":"","url":"https://api.github.com/users/iamthomaspowell","html_url":"https://github.com/iamthomaspowell","followers_url":"https://api.github.com/users/iamthomaspowell/followers","following_url":"https://api.github.com/users/iamthomaspowell/following{/other_user}","gists_url":"https://api.github.com/users/iamthomaspowell/gists{/gist_id}","starred_url":"https://api.github.com/users/iamthomaspowell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamthomaspowell/subscriptions","organizations_url":"https://api.github.com/users/iamthomaspowell/orgs","repos_url":"https://api.github.com/users/iamthomaspowell/repos","events_url":"https://api.github.com/users/iamthomaspowell/events{/privacy}","received_events_url":"https://api.github.com/users/iamthomaspowell/received_events","type":"User","site_admin":false},"repo":{"id":63046724,"name":"http-remoting","full_name":"iamthomaspowell/http-remoting","owner":{"login":"iamthomaspowell","id":18428827,"avatar_url":"https://avatars.githubusercontent.com/u/18428827?v=3","gravatar_id":"","url":"https://api.github.com/users/iamthomaspowell","html_url":"https://github.com/iamthomaspowell","followers_url":"https://api.github.com/users/iamthomaspowell/followers","following_url":"https://api.github.com/users/iamthomaspowell/following{/other_user}","gists_url":"https://api.github.com/users/iamthomaspowell/gists{/gist_id}","starred_url":"https://api.github.com/users/iamthomaspowell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamthomaspowell/subscriptions","organizations_url":"https://api.github.com/users/iamthomaspowell/orgs","repos_url":"https://api.github.com/users/iamthomaspowell/repos","events_url":"https://api.github.com/users/iamthomaspowell/events{/privacy}","received_events_url":"https://api.github.com/users/iamthomaspowell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iamthomaspowell/http-remoting","description":"a collection of useful utilities for use with HTTP remoting setups that use Feign as a client and Jersey as a server","fork":true,"url":"https://api.github.com/repos/iamthomaspowell/http-remoting","forks_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/forks","keys_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/teams","hooks_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/hooks","issue_events_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/issues/events{/number}","events_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/events","assignees_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/assignees{/user}","branches_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/branches{/branch}","tags_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/tags","blobs_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/git/refs{/sha}","trees_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/statuses/{sha}","languages_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/languages","stargazers_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/stargazers","contributors_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/contributors","subscribers_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/subscribers","subscription_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/subscription","commits_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/commits{/sha}","git_commits_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/git/commits{/sha}","comments_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/comments{/number}","issue_comment_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/issues/comments{/number}","contents_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/contents/{+path}","compare_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/merges","archive_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/downloads","issues_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/issues{/number}","pulls_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/pulls{/number}","milestones_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/milestones{/number}","notifications_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/labels{/name}","releases_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/releases{/id}","deployments_url":"https://api.github.com/repos/iamthomaspowell/http-remoting/deployments","created_at":"2016-07-11T07:30:57Z","updated_at":"2016-07-11T07:30:58Z","pushed_at":"2016-07-12T18:37:54Z","git_url":"git://github.com/iamthomaspowell/http-remoting.git","ssh_url":"git@github.com:iamthomaspowell/http-remoting.git","clone_url":"https://github.com/iamthomaspowell/http-remoting.git","svn_url":"https://github.com/iamthomaspowell/http-remoting","homepage":"","size":547,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"86d7a796a28f5a299b5615afc1af2ef8c7d488fd","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":43088077,"name":"http-remoting","full_name":"palantir/http-remoting","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/http-remoting","description":"a collection of useful utilities for use with HTTP remoting setups that use Feign as a client and Jersey as a server","fork":false,"url":"https://api.github.com/repos/palantir/http-remoting","forks_url":"https://api.github.com/repos/palantir/http-remoting/forks","keys_url":"https://api.github.com/repos/palantir/http-remoting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/http-remoting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/http-remoting/teams","hooks_url":"https://api.github.com/repos/palantir/http-remoting/hooks","issue_events_url":"https://api.github.com/repos/palantir/http-remoting/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/http-remoting/events","assignees_url":"https://api.github.com/repos/palantir/http-remoting/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/http-remoting/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/http-remoting/tags","blobs_url":"https://api.github.com/repos/palantir/http-remoting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/http-remoting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/http-remoting/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/http-remoting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/http-remoting/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/http-remoting/languages","stargazers_url":"https://api.github.com/repos/palantir/http-remoting/stargazers","contributors_url":"https://api.github.com/repos/palantir/http-remoting/contributors","subscribers_url":"https://api.github.com/repos/palantir/http-remoting/subscribers","subscription_url":"https://api.github.com/repos/palantir/http-remoting/subscription","commits_url":"https://api.github.com/repos/palantir/http-remoting/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/http-remoting/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/http-remoting/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/http-remoting/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/http-remoting/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/http-remoting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/http-remoting/merges","archive_url":"https://api.github.com/repos/palantir/http-remoting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/http-remoting/downloads","issues_url":"https://api.github.com/repos/palantir/http-remoting/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/http-remoting/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/http-remoting/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/http-remoting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/http-remoting/labels{/name}","releases_url":"https://api.github.com/repos/palantir/http-remoting/releases{/id}","deployments_url":"https://api.github.com/repos/palantir/http-remoting/deployments","created_at":"2015-09-24T19:24:22Z","updated_at":"2016-07-05T17:41:40Z","pushed_at":"2016-07-13T01:12:44Z","git_url":"git://github.com/palantir/http-remoting.git","ssh_url":"git@github.com:palantir/http-remoting.git","clone_url":"https://github.com/palantir/http-remoting.git","svn_url":"https://github.com/palantir/http-remoting","homepage":"","size":847,"stargazers_count":13,"watchers_count":13,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":18,"forks":24,"open_issues":18,"watchers":13,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/158"},"html":{"href":"https://github.com/palantir/http-remoting/pull/158"},"issue":{"href":"https://api.github.com/repos/palantir/http-remoting/issues/158"},"comments":{"href":"https://api.github.com/repos/palantir/http-remoting/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/http-remoting/statuses/06fb4d86888244f9936355100bd9c72b92e333ba"}}}}
{"actor":{"display_login":"markelliot"}}