Skip to content
Open
Changes from 1 commit
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
Next Next commit
Fix hostname resolution for proxied connections
  • Loading branch information
bartosz822 committed Oct 30, 2025
commit f162017eb647a0a3c2ceed589f51e44ec486a4da
4 changes: 3 additions & 1 deletion src/main/java/io/nats/client/impl/SocketDataPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public void connect(@NonNull NatsConnection conn, @NonNull NatsUri nuri, long ti
socket = connectToFastestIp(options, host, port, (int) timeout);
} else {
socket = createSocket(options);
socket.connect(new InetSocketAddress(host, port), (int) timeout);
InetSocketAddress inetSocketAddress = options.isNoResolveHostnames() ?
InetSocketAddress.createUnresolved(host, port) : new InetSocketAddress(host, port);
socket.connect(inetSocketAddress, (int) timeout);
}

if (options.getSocketReadTimeoutMillis() > 0) {
Expand Down