@@ -33,8 +33,13 @@ import (
33
33
// where only the reading/writing goroutines are interrupted but the connection
34
34
// is kept alive.
35
35
//
36
- // The Addr methods will return a mock net.Addr that returns "websocket" for Network
37
- // and "websocket/unknown-addr" for String.
36
+ // The Addr methods will return the real addresses for connections obtained
37
+ // from websocket.Accept. But for connections obtained from websocket.Dial, a mock net.Addr
38
+ // will be returned that gives "websocket" for Network() and "websocket/unknown-addr" for
39
+ // String(). This is because websocket.Dial only exposes a io.ReadWriteCloser instead of the
40
+ // full net.Conn to us.
41
+ //
42
+ // When running as WASM, the Addr methods will always return the mock address described above.
38
43
//
39
44
// A received StatusNormalClosure or StatusGoingAway close frame will be translated to
40
45
// io.EOF when reading.
@@ -181,14 +186,6 @@ func (a websocketAddr) String() string {
181
186
return "websocket/unknown-addr"
182
187
}
183
188
184
- func (nc * netConn )RemoteAddr () net.Addr {
185
- return websocketAddr {}
186
- }
187
-
188
- func (nc * netConn )LocalAddr () net.Addr {
189
- return websocketAddr {}
190
- }
191
-
192
189
func (nc * netConn )SetDeadline (t time.Time )error {
193
190
nc .SetWriteDeadline (t )
194
191
nc .SetReadDeadline (t )