Skip to content

websockets: Add reason, code and wasClean fields for close event #4972

@etodanik

Description

@etodanik

Brief summary

MDN documentation for this event:
https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event

It's very important information to know the closure code and reason when a remote websocket closes connection.

k6 version

latest

OS

all

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Get a weboscket server closure, and check if those fields exist

Expected behaviour

Those fields should exist and be populated

Actual behaviour

The fields don't exist

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions