Änderungen von Dokument Set proxy settings via script

Inhalt · Anhänge (0)
Von Version 3.1
bearbeitet von ritter
am 18.03.2013
Auf Version 4.1
bearbeitet von ritter
am 18.03.2013
Änderungskommentar: Es gibt keinen Kommentar für diese Version

Inhaltsänderungen

... ... @@ -7,6 +7,9 @@
7 7 Below is an example on how to set a custom proxy:
8 8
9 9 {{code language="java"}}
10 +import com.AMS.jbeam_utils.io.*;
11 +import com.AMS.jbeam_utils.io.ProxyProvider.ProxyParameters;
12 +
10 10 // create new proxy parameters
11 11 ProxyParameters proxyParameters = new ProxyParameters();
12 12 proxyParameters.setProxyHost("my-proxy-host");
... ... @@ -16,15 +16,19 @@
16 16 proxyParameters.setUserName("my-proxy-user");
17 17 proxyParameters.setPassword("my-proxy-password");
18 18 // set proxy parameters and enable usage of custom proxy
19 -ProxyProvider.setCustomProxyParameters(defaultProxyParameters);
20 -ProxyProvider.setUseCustomProxy(true);
22 +ProxyProvider proxyProvider = ProxyProvider.getInstance();
23 +proxyProvider.setCustomProxyParameters(proxyParameters);
24 +proxyProvider.setUseCustomProxy(true);
21 21 {{/code}}
22 22
23 23 Alternatively you can enable the usage of the system default proxy:
24 24
25 25 {{code language="java"}}
30 +import com.AMS.jbeam_utils.io.ProxyProvider;
31 +
26 26 // enable usage of system proxy
27 -ProxyProvider.setUseSystemProxy(true);
33 +ProxyProvider proxyProvider = ProxyProvider.getInstance();
34 +proxyProvider.setUseSystemProxy(true);
28 28 {{/code}}
29 29
30 30 If you enable the system default {{jbeam-sign/}} automatically disables the custom proxy settings and vice versa.

Copyright by Kistler Chemnitz GmbH 2021
XWiki Enterprise 4.4 - Documentation