wso2 / carbon-device-mgt

Apache License 2.0
53 stars 113 forks source link

Add capability to WSO2 IOT server to route HTTP/HTTPS calls through Proxy server #1244

Closed madhawap closed 6 years ago

madhawap commented 6 years ago

Purpose

In an IoT server cluster setup if we configure the worker or manager node calls to be routed through a proxy the communication fails. Purpose of this PR is to fix this issue. Resolves wso2/product-iots#1806

Goals

It appears that certain HTTP calls from IoT Server's worker node to the gateway is bypassing the configured proxy. This could be due to the HTTP client that we are using. We use library call Feign in IoT server. Feign is a Java to HTTP client binder. Hence goal is to enable the HTTP calls to be the route through a configured proxy.

Approach

Feign client is not supporting proxy routing this fix has included okhttp client and pass it to the feigns okkhttp client wrapper in order to pass HTTP/HTTPS call through proxy server if the system proxy properties are set. Further this modifies the apache http client also to pick system properties.

User stories

N/A

Release note

N/A

Documentation

N/A

Training

N/A

Certification

N/A

Marketing

N/A

Automation tests

Security checks

Samples

N/A

Related PRs

N/A

Migrations (if applicable)

N/A

Test environment

On a WSO2 clustered environment

Learning

WSO2 IoT Server clustering, HTTP/S call routing

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity.