diff --git a/relay/client/dialer/ws/addr.go b/relay/client/dialer/ws/addr.go new file mode 100644 index 000000000..2bdffb864 --- /dev/null +++ b/relay/client/dialer/ws/addr.go @@ -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" +} diff --git a/relay/client/dialer/ws/conn.go b/relay/client/dialer/ws/conn.go index fc07fc3f3..bc8675e8e 100644 --- a/relay/client/dialer/ws/conn.go +++ b/relay/client/dialer/ws/conn.go @@ -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 { diff --git a/relay/client/dialer/ws/ws.go b/relay/client/dialer/ws/ws.go index ccdfe2d9c..19ec44a1e 100644 --- a/relay/client/dialer/ws/ws.go +++ b/relay/client/dialer/ws/ws.go @@ -31,6 +31,7 @@ func Dial(address string) (net.Conn, error) { if resp.Body != nil { _ = resp.Body.Close() } + conn := NewConn(wsConn) return conn, nil }