Configuring an HTTP Proxy for Oracle Graph Client Connections

You can use the http_proxy parameter when using the Java or Python client to connect to a remote graph server (PGX) through an HTTP or HTTPS proxy.

You can specify the proxy as a URI in one of the following formats:

As seen in the preceding formats, the URI must contain an http or https scheme, a valid proxy host, and an optional port.

The following command specifies the --http_proxy parameter to use a proxy configuration when connecting to a remote graph server (PGX) from the graph clients.

./bin/opg4j --base_url <server_host>:7007 --username <username> --http_proxy <proxy_host>:<port>
/bin/opg4py --base_url <server_host>:7007 --username <username> --http_proxy <proxy_host>:<port>

The proxy is configured separately for each client instance. If you omit the http_proxy parameter, the client connects directly to the graph server.

Also, note the following:

When configuring the graph client programmatically using the ClientConfig object, you can set HTTP proxy as shown in the following example:

var clientConfig =
  ClientConfigBuilder.
    forBaseUrl("<graph_server_host>:<port>").
    setHttpProxy("<proxy_host>:<proxy_port>").
    build()

var instance = GraphServer.getInstance(clientConfig, "<username>", "<password_for user>".toCharArray())
ClientConfig clientConfig =
  ClientConfigBuilder
    .forBaseUrl("<graph_server_host>:<port>")
    .setHttpProxy("<proxy_host>:<proxy_port>")
    .build();

ServerInstance instance = GraphServer.getInstance(clientConfig, "<username>", "<password_for user>".toCharArray());
from opg4py import graph_server
instance = graph_server.get_instance(
    base_url="<graph_server_host>:<port>",
    username="<username>",
    password="<password_for user>"
    http_proxy="<proxy_host>:<proxy_port>"
)