Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ The following code snippet shows how you can call the Google Cloud PubSub API us

```java
// Create a channel to the test service.
ManagedChannel channel = ManagedChannelBuilder.forTarget("pubsub.googleapis.com")
ManagedChannel channel = ManagedChannelBuilder.forTarget("dns:///pubsub.googleapis.com")
.build();
// Get the default credentials from the environment
GoogleCredentials creds = GoogleCredentials.getApplicationDefault();
Expand Down
7 changes: 5 additions & 2 deletions api/src/main/java/io/grpc/ManagedChannelBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public static ManagedChannelBuilder<?> forAddress(String name, int port) {
* </ul>
*
* <p>An authority string will be converted to a {@code NameResolver}-compliant URI, which has
* {@code "dns"} as the scheme, no authority, and the original authority string as its path after
* properly escaped. Example authority strings:
* the scheme from the name resolver with the highest priority (e.g. {@code "dns"}),
* no authority, and the original authority string as its path after properly escaped.
* We recommend libraries to specify the schema explicitly if it is known, since libraries cannot
* know which NameResolver will be default during runtime.
* Example authority strings:
* <ul>
* <li>{@code "localhost"}</li>
* <li>{@code "127.0.0.1"}</li>
Expand Down