diff --git a/ws/message.go b/ws/message.go index 3060d5a..006644b 100644 --- a/ws/message.go +++ b/ws/message.go @@ -166,7 +166,11 @@ func (m Message) Send(writer io.Writer) error { } /* (1) Byte 0 : FIN + opcode */ - header = append(header, 0x80 | byte(TEXT) ) + var final byte = 0x80 + if !m.Final { + final = 0 + } + header = append(header, final | byte(m.Type) ) /* (2) Get payload length */ if m.Size < 126 { // simple