udp

package module
v0.0.0-...-709f500 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 4 Imported by: 0

README

xk6-tls

A k6 extension for sending data to tcp tls port

Build

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

Then:

  1. Install xk6:
go install go.k6.io/xk6/cmd/xk6@latest
  1. Build the binary:
xk6 build master \
  --with github.com/dhruvit96/xk6-tls

Example

import tls from 'k6/x/tls';
import { check } from 'k6';

const conn = tls.connect('host:port');

export default function () {
  tls.write(conn, 'Say Hello');
  let res = String.fromCharCode(...tls.read(conn, 1024))
  check (res, {
    'verify ag tag': (res) => res.includes('Hello')
  });
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TLS

type TLS struct{}

func (*TLS) Close

func (u *TLS) Close(conn net.Conn) error

func (*TLS) Connect

func (u *TLS) Connect(address string) (net.Conn, error)

func (*TLS) Read

func (u *TLS) Read(conn net.Conn, size int, timeout_opt ...int) ([]byte, error)

func (*TLS) Write

func (u *TLS) Write(conn net.Conn, data []byte) error

func (*TLS) Writeln

func (u *TLS) Writeln(conn net.Conn, data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL