diff --git a/frame.go b/frame.go index e223fca..c4a1167 100644 --- a/frame.go +++ b/frame.go @@ -358,9 +358,9 @@ func (fr *Frame) setLength(n int) { // Mask performs the masking of the current payload func (fr *Frame) Mask() { + fr.op[1] |= maskBit + readMask(fr.mask) if len(fr.b) > 0 { - fr.op[1] |= maskBit - readMask(fr.mask) mask(fr.mask, fr.b) } } diff --git a/go.mod b/go.mod index affe480..2cd33cd 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,9 @@ module github.com/dgrr/fastws go 1.14 -require github.com/valyala/fasthttp v1.12.0 +require ( + github.com/gobwas/ws v1.0.4 + github.com/gorilla/websocket v1.4.2 + github.com/valyala/fasthttp v1.12.0 + nhooyr.io/websocket v1.8.6 +)