Set Up A Proxy

The Data Client Base Library allows to configure a proxy server for connecting to the HERE platform. You can configure a proxy either programmatically or in the application.conf file.

Programmatic Configuration

When you create any instance of BaseClient, you can pass a custom Settings object that specifies your proxy configuration:

To configure your proxy programmatically, add the following:

Scala
Java
val proxyPort = 8080
val proxyHost = "localhost"
val proxyLogin = "user"
val proxyPass = "pass"
val proxySettings =
  ProxySettings(proxyHost, proxyPort, Some(ProxyCredentials(proxyLogin, proxyPass)))

val client = BaseClient(proxySettings = Some(proxySettings))
val metadataApi = client.of[MetadataApi]
int proxyPort = 8080;
String proxyHost = "localhost";
String proxyLogin = "user";
String proxyPass = "pass";
ProxySettings proxySettings =
    new ProxySettings.Builder()
        .withHost(proxyHost)
        .withPort(proxyPort)
        .withCredentials(new ProxyCredentials(proxyLogin, proxyPass))
        .build();

BaseClient client = new BaseClientJava.Builder().withProxySetting(proxySettings).build();
MetadataApi metadataApi = new MetadataApi(client);

Configuration in the Properties File

Use the following code snippet in your properties file to configure your proxy in the application configuration:

com.here.platform.data.client {
    proxy {
        host = "localhost"
        port = 9999
        credentials {
            username: "user"
            password: "pass"
        }
    }
}

For more details on configuration properties, see the Configuration chapter.

results matching ""

    No results matching ""