diff --git a/router/local_peer.go b/router/local_peer.go index 9d0356f2..1b1160f5 100644 --- a/router/local_peer.go +++ b/router/local_peer.go @@ -250,7 +250,7 @@ func (peer *LocalPeer) handleConnectionEstablished(conn *LocalConnection) { func (peer *LocalPeer) handleSendProtocolMsg(m ProtocolMsg) { peer.ForEachConnection(func(_ PeerName, conn Connection) { - conn.(*LocalConnection).SendProtocolMsg(m) + conn.(ProtocolSender).SendProtocolMsg(m) }) } diff --git a/router/protocol.go b/router/protocol.go index 1d8cd104..2218d813 100644 --- a/router/protocol.go +++ b/router/protocol.go @@ -21,3 +21,7 @@ type ProtocolMsg struct { tag ProtocolTag msg []byte } + +type ProtocolSender interface { + SendProtocolMsg(m ProtocolMsg) +}