Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Settings in SDK API #15

Closed
faisalbasra opened this issue Mar 23, 2016 · 8 comments
Closed

Proxy Settings in SDK API #15

faisalbasra opened this issue Mar 23, 2016 · 8 comments

Comments

@faisalbasra
Copy link

Is there any option to setup proxy settings in sdk/api, because most of organization have proxy server for Internet access. Thanks

@JiamingFB
Copy link
Contributor

For now, you can modify the APIRequest.java file and add Proxy as argument to url.openConnection(). https://docs.oracle.com/javase/7/docs/api/java/net/URL.html#openConnection(java.net.Proxy)

I'm also working on decoupling network from other logic, so that you can customize it for your use case. The change will come with next version.

@faisalbasra
Copy link
Author

Alright. I cloned and setup project in eclipse/inteliJ but getting errors "incompatible types" for many classes. Can you tell how I can checkout/setup sdk project. Thanks

@JiamingFB
Copy link
Contributor

Hi, the source code can still be compiled by apache maven. You can install by following instructions on https://maven.apache.org/install.html

"incompatible types" is an issue that I'm working on right now.
It's due to Java's type erasure implementation of generic and some compiler might throw compilation errors. After type erasure, the parseResponse() function of APINode has the same signature as parseResponse() in subclasses, however List is not a super class of List<[sub class]>.

@JiamingFB
Copy link
Contributor

I have applied a temp fix to unblock development in IDE. You can pull the latest code. Meanwhile i'll try to figure out if there is a better way of resolving the issue. Thanks!

@JiamingFB
Copy link
Contributor

The customization of sending GET/POST/DELETE requests is added in latest version, which can be used to change your network proxy. You can refer to example/NetworkCustomizationExample.java.

@faisalbasra
Copy link
Author

Jiaming, can you add example how to set proxy with NetworkCustomizationExample.java because I can't find a way for adding proxy.

@bsheikh
Copy link

bsheikh commented Jan 15, 2018

Can you elaborate on how to set the proxy? Looking through the APIContext, I don't see an option where the proxy can be added

@hehan-wang
Copy link

https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
This doc may help you~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants