Skip to content

Commit a6b6d19

Browse files
committed
Update localAddress Javadoc in WebSocketSession
Closes gh-34304
1 parent 9b58df8 commit a6b6d19

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -73,6 +73,12 @@ public interface WebSocketSession extends Closeable {
7373

7474
/**
7575
* Return the address on which the request was received.
76+
* <p><strong>Note:</strong> The localAddress is not always possible to access,
77+
* which is the case with the Standard WebSocket client. In 6.2.x
78+
* {@link org.springframework.web.socket.client.standard.StandardWebSocketClient}
79+
* returns an address based on the local host and the port of the target
80+
* address (not the same as the local port). In 7.0, the same will return
81+
* {@code null} instead.
7682
*/
7783
@Nullable
7884
InetSocketAddress getLocalAddress();

0 commit comments

Comments
 (0)