Set up Proxy servers to the HERE platform
Set up Proxy servers to the HERE platform
The Data Client Library allows to configure a proxy server for connecting to the HERE platform. You can configure proxies either programmatically or in the properties file.
Programmatic configuration
When you create a ReadEngine, WriteEngine, or any Api object from
DataClient, you can pass a custom Settings object that specifies your proxy
configuration:
To configure your proxy programmatically, add the following:
val dataClient = DataClient()
val proxySettings =
ProxySettings(proxyHost, proxyPort, Some(ProxyCredentials(proxyLogin, proxyPass)))
val customSettings = dataClient.defaultSettings.withProxySettings(proxySettings)
dataClient.adminApi(settings = customSettings)DataClient dataClient = DataClient.get(myActorSystem);
ProxyCredentials credentials = new ProxyCredentials(proxyLogin, proxyPass);
ProxySettings proxySettings =
new ProxySettings.Builder()
.withHost(proxyHost)
.withPort(proxyPort)
.withCredentials(credentials)
.build();
Settings customSettings = dataClient.defaultSettings().withProxySettings(proxySettings);
dataClient.adminApi(customSettings);Configuration in the properties file
Use the following code snippet in your properties file to configure your proxy in the application configuration:
here.platform.data-client {
proxy {
host = "localhost"
port = 9999
credentials {
username: "user"
password: "pass"
}
}
}
For more details on configuration properties, see the Configuration section.
Updated 21 days ago