We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
vishal s.7
11 years agoNew member | Level 1
Using proxy setting in java sdk
Hello
I am working in the network that uses proxy setting. How can I mention the Proxy setting in java sdk?
public static void main(String[] args) throws IOException, DbxException {
// Get your app key and secret from the Dropbox developers website.
final String APP_KEY = "f1klbew9x73o79w";
final String APP_SECRET = "xxxxxxxxxxxxxx";
DbxAppInfo appInfo = new DbxAppInfo(APP_KEY, APP_SECRET);
DbxRequestConfig config = new DbxRequestConfig("JavaTutorial/1.0",
Locale.getDefault().toString());
DbxWebAuthNoRedirect webAuth = new DbxWebAuthNoRedirect(config, appInfo);
// Have the user sign in and authorize your app.
String authorizeUrl = webAuth.start();
System.out.println("1. Go to: " + authorizeUrl);
System.out.println("2. Click \"Allow\" (you might have to log in first)");
System.out.println("3. Copy the authorization code.");
//String code = new BufferedReader(new InputStreamReader(System.in)).readLine().trim();
// This will fail if the user enters an invalid authorization code.
//DbxAuthFinish authFinish = webAuth.finish(code);
String accessToken = "XXX";//authFinish.accessToken;
DbxClient client = new DbxClient(config, accessToken);
System.out.println("Linked account: " + client.getAccountInfo().displayName);
}
Above program works fine in network with no proxy.
Thanks in advance
1 Reply
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
I unfortunately don't have any actual sample code for this, but I believe you can supply a proxy object to this
StandardHttpRequestorconstructor:And then you can supply that
HttpRequestorto thisDbxRequestConfigconstructor:
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!