This extension adds a PoC Websockets API implementation to k6.
This is meant to try to implement the specification as close as possible without doing stuff that don't make sense in k6 like:
- not reporting errors
- not allowing some ports and other security workarounds
- supporting Blob as message
It likely in the future will support additional k6 specific features such as:
- adding additional tags
- support for ping/pong which isn't part of the specification
It is implemented using the xk6 system.
- Install
xk6
:
$ go install go.k6.io/xk6/cmd/xk6@latest
- Build the binary:
$ xk6 build --with github.com/grafana/xk6-websockets
- binaryType is "ArrayBuffer" by default instead of "Blob" and will throw an exception if it's tried to be changed as "Blob" is not supported by k6.