Skip to content
/ xk6-wamp Public

A k6 extension that adds support for WAMP protocol.

Notifications You must be signed in to change notification settings

vvarp/xk6-wamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xk6-wamp

This is a WAMP protocol client library for k6, implemented as an extension using the xk6 system.

It is based on nexus WAMP client library.

❗ This is a proof of concept, isn't supported by the k6 team, and may break in the future. USE AT YOUR OWN RISK!

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

Then:

  1. Install xk6:
go install go.k6.io/xk6/cmd/xk6@latest
  1. Build the binary:
make build

Example test script

import wamp from 'k6/x/wamp';
import { sleep } from 'k6';

export default function () {
    const client = new wamp.Client(
        "ws://127.0.0.1:9000",
        {
            realm: "default",
        }
    );

    const subId = client.subscribe("test", {}, function (args, kwargs) {
        console.log(args, kwargs)
    });

    const sessId = client.getSessionID();
    console.log(`Subscription ID: ${sessId} ${subId}`)

    sleep(Math.random() * 2);

    client.disconnect()
}

About

A k6 extension that adds support for WAMP protocol.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published