No results for ""

Powered byAlgolia


Send a data string through the connection. Binary data is not currently supported. You can use JSON.stringify to convert a JSON or JavaScript values to a JSON string.

Parameter Type Description
data string The data to send.


import ws from 'k6/ws';

export default function() {
  var url = 'ws://';
  var response = ws.connect(url, null, function(socket) {
    socket.on('open', function() {
      socket.send(JSON.stringify({ data: 'hola' }));