diff --git a/ws/message.go b/ws/message.go index e577eb7..58b6f5f 100644 --- a/ws/message.go +++ b/ws/message.go @@ -149,7 +149,7 @@ func readMessage(reader io.Reader) (*Message, error){ // Send sends a frame over a socket -func (m Message) Send(socket net.Conn) error { +func (m Message) Send(writer io.Writer) error { header := make([]byte, 0, maximumHeaderSize) @@ -190,7 +190,7 @@ func (m Message) Send(socket net.Conn) error { writeBuf = append(writeBuf, m.Data[0:m.Size]...) /* (4) Send over socket */ - _, err := socket.Write(writeBuf) + _, err := writer.Write(writeBuf) if err != nil { return err } return nil