Skip to content

Commit 66c8daa

Browse files
authored
Merge pull request #1161 from watson-developer-cloud/update-readme
chore(readme): update readme to contain info for setting up a proxy w…
2 parents bd6ae8b + f7d75d3 commit 66c8daa

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.utility/decrypt-service-instance-apikeys.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
33
echo -e "Decrypt service instance apikeys for branch $TRAVIS_BRANCH.\n"
4-
openssl aes-256-cbc -K $encrypted_5b4197fb87e6_key -iv $encrypted_5b4197fb87e6_iv \
4+
openssl aes-256-cbc -K $encrypted_b3aab48b571a_key -iv $encrypted_b3aab48b571a_iv \
55
-in config.properties.enc -out common/src/test/resources/config.properties -d
66
else
77
echo -e "Not Decrypt service instance apikeys for branch $TRAVIS_BRANCH.\n"

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,20 +275,24 @@ System.out.println("Response header names: " + responseHeaders.names());
275275

276276
### Configuring the HTTP client
277277

278-
The HTTP client can be configured by using the `configureClient()` method on your service object, passing in an `HttpConfigOptions` object. Currently, the following options are supported:
278+
The HTTP client can be configured by using the `setProxy()` method on your authenticator and using the `configureClient()` method on your service object, passing in an `HttpConfigOptions` object. Currently, the following options are supported:
279279
- Disabling SSL verification (only do this if you really mean to!) ⚠️
280280
- Using a proxy (more info here: [OkHTTPClient Proxy authentication how to?](https://stackoverflow.com/a/35567936/456564))
281281
- Setting HTTP logging verbosity
282282

283283
Here's an example of setting the above:
284284

285285
```java
286-
Discovery service = new Discovery("2019-04-30");
286+
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyHost", 8080));
287+
IamAuthenticator authenticator = new IamAuthenticator(apiKey);
288+
authenticator.setProxy(proxy);
289+
290+
Discovery service = new Discovery("2019-04-30", authenticator);
287291

288292
// setting configuration options
289293
HttpConfigOptions options = new HttpConfigOptions.Builder()
290294
.disableSslVerification(true)
291-
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyHost", 8080)))
295+
.proxy(proxy)
292296
.loggingLevel(HttpConfigOptions.LoggingLevel.BASIC)
293297
.build();
294298

assistant/src/test/java/com/ibm/watson/assistant/v1/AssistantServiceIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ public void testDeleteUserData() {
17701770
/** Test list mentions. */
17711771
@Test
17721772
public void testListMentions() {
1773-
String entity = "holiday";
1773+
String entity = "beverage";
17741774

17751775
ListMentionsOptions listMentionsOptions =
17761776
new ListMentionsOptions.Builder().workspaceId(workspaceId).entity(entity).build();

config.properties.enc

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)