mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-13 10:21:10 +01:00
Implement dummy RemoteAddr on client conn
This commit is contained in:
parent
1f95467b02
commit
e0d086a8a8
12
relay/client/dialer/ws/addr.go
Normal file
12
relay/client/dialer/ws/addr.go
Normal file
@ -0,0 +1,12 @@
|
||||
package ws
|
||||
|
||||
type WebsocketAddr struct {
|
||||
}
|
||||
|
||||
func (a WebsocketAddr) Network() string {
|
||||
return "websocket"
|
||||
}
|
||||
|
||||
func (a WebsocketAddr) String() string {
|
||||
return "websocket/unknown-addr"
|
||||
}
|
@ -40,11 +40,11 @@ func (c *Conn) Write(b []byte) (n int, err error) {
|
||||
}
|
||||
|
||||
func (c *Conn) RemoteAddr() net.Addr {
|
||||
panic("RemoteAddr is not implemented")
|
||||
return WebsocketAddr{}
|
||||
}
|
||||
|
||||
func (c *Conn) LocalAddr() net.Addr {
|
||||
panic("LocalAddr is not implemented")
|
||||
return WebsocketAddr{}
|
||||
}
|
||||
|
||||
func (c *Conn) SetReadDeadline(t time.Time) error {
|
||||
|
@ -31,6 +31,7 @@ func Dial(address string) (net.Conn, error) {
|
||||
if resp.Body != nil {
|
||||
_ = resp.Body.Close()
|
||||
}
|
||||
|
||||
conn := NewConn(wsConn)
|
||||
return conn, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user