diff --git a/docs/sources/k6/next/get-started/write-your-first-test.md b/docs/sources/k6/next/get-started/write-your-first-test.md index a64d1d03af..42370ba34b 100644 --- a/docs/sources/k6/next/get-started/write-your-first-test.md +++ b/docs/sources/k6/next/get-started/write-your-first-test.md @@ -80,7 +80,7 @@ export const options = { }; // The default exported function is gonna be picked up by k6 as the entry point for the test script. It will be executed repeatedly in "iterations" for the whole duration of the test. - export default function() { + export default function () { // Make a GET request to the target URL http.get('https://quickpizza.grafana.com'); diff --git a/docs/sources/k6/next/javascript-api/k6-ws/connect.md b/docs/sources/k6/next/javascript-api/k6-ws/connect.md index be9761fed5..ac99c7bf8e 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/connect.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/connect.md @@ -11,7 +11,7 @@ weight: 10 Initiate a WebSocket connection to a remote host. -Calling connect will block the VU finalization until the WebSocket connection is closed. Instead of continuously looping the main function (`export default function() { ... }`) over an over, each VU will be halted listening to async events and executing their event handlers until the connection is closed. +Calling connect will block the VU finalization until the WebSocket connection is closed. Instead of continuously looping the main function (`export default function () { ... }`) over an over, each VU will be halted listening to async events and executing their event handlers until the connection is closed. The following events can close the connection: @@ -21,7 +21,7 @@ The following events can close the connection: | Parameter | Type | Description | | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| url | string | Request URL (e.g. "ws://echo.websocket.org"). | +| url | string | Request URL (e.g. "wss://echo.websocket.org"). | | params | object | [Params](https://grafana.com/docs/k6//javascript-api/k6-ws/params) object containing additional request parameters. | | callback | function | The callback function that will be called when the WebSocket connection is initiated. A [Socket](https://grafana.com/docs/k6//javascript-api/k6-ws/socket) object will be passed to the function, and this object can be used to set up callbacks etc when things happen on the WebSocket connection | @@ -39,7 +39,7 @@ The following events can close the connection: import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const resp = ws.connect(url, null, function (socket) { socket.on('open', function () { console.log('WebSocket connection established!'); diff --git a/docs/sources/k6/next/javascript-api/k6-ws/params.md b/docs/sources/k6/next/javascript-api/k6-ws/params.md index 6599172648..16711387ec 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/params.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/params.md @@ -28,7 +28,7 @@ _A k6 script that will make a WebSocket request with a custom header and tag res import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { headers: { 'X-MyHeader': 'k6test' }, tags: { k6test: 'yes' }, diff --git a/docs/sources/k6/next/javascript-api/k6-ws/socket/_index.md b/docs/sources/k6/next/javascript-api/k6-ws/socket/_index.md index 8165fa0670..3120712fc7 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/socket/_index.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/socket/_index.md @@ -37,7 +37,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-close.md b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-close.md index 359e7eed1f..efeaf662b6 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-close.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-close.md @@ -21,7 +21,7 @@ Close the WebSocket connection. import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.close(); diff --git a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-on.md b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-on.md index a9a49e4acd..98094ed352 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-on.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-on.md @@ -32,7 +32,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-ping.md b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-ping.md index 88a387bdd2..ca27aba7ec 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-ping.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-ping.md @@ -17,7 +17,7 @@ Send a ping. Ping messages can be used to verify that the remote endpoint is res import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.on('pong', function () { diff --git a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-send.md b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-send.md index c1f6bc07d8..4959b617f6 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-send.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-send.md @@ -22,7 +22,7 @@ You can use `JSON.stringify` to convert a JSON or JavaScript values to a JSON st import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.send('my-message'); diff --git a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-setinterval.md b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-setinterval.md index f68bd1fb50..b1b92ead89 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-setinterval.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-setinterval.md @@ -23,7 +23,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-settimeout.md b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-settimeout.md index b23f2ebfd1..ddee5b274a 100644 --- a/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-settimeout.md +++ b/docs/sources/k6/next/javascript-api/k6-ws/socket/socket-settimeout.md @@ -24,7 +24,7 @@ import { sleep } from 'k6'; export default function () { console.log('T0: Script started'); - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { console.log('T0: Entered WebSockets run loop'); socket.setTimeout(function () { diff --git a/docs/sources/k6/next/using-k6/http-debugging.md b/docs/sources/k6/next/using-k6/http-debugging.md index 8d0d28e5d3..a0fcdaeea9 100644 --- a/docs/sources/k6/next/using-k6/http-debugging.md +++ b/docs/sources/k6/next/using-k6/http-debugging.md @@ -22,7 +22,7 @@ Given the following script: ```javascript import http from "k6/http"; -export default function() { +export default function () { http.get("https://google.com/"); } ``` diff --git a/docs/sources/k6/next/using-k6/protocols/websockets.md b/docs/sources/k6/next/using-k6/protocols/websockets.md index 97dfdcb83b..c01715acd5 100644 --- a/docs/sources/k6/next/using-k6/protocols/websockets.md +++ b/docs/sources/k6/next/using-k6/protocols/websockets.md @@ -22,7 +22,7 @@ Currently, it's available as an experimental module [`k6/experimental/websockets {{< /admonition >}} Comparing HTTP-based tests to WebSocket ones, you'll find differences in both structure and inner workings. -The primary difference is that instead of continuously looping the main function (`export default function() { ... }`) over and over, each VU is now runs an asynchronous event loop. +The primary difference is that instead of continuously looping the main function (`export default function () { ... }`) over and over, each VU is now runs an asynchronous event loop. The basic structure of a WebSocket test looks like this: @@ -33,7 +33,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -65,7 +65,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -97,7 +97,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -132,7 +132,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -164,7 +164,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/connect.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/connect.md index be9761fed5..bd61160b61 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/connect.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/connect.md @@ -21,7 +21,7 @@ The following events can close the connection: | Parameter | Type | Description | | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| url | string | Request URL (e.g. "ws://echo.websocket.org"). | +| url | string | Request URL (e.g. "wss://echo.websocket.org"). | | params | object | [Params](https://grafana.com/docs/k6//javascript-api/k6-ws/params) object containing additional request parameters. | | callback | function | The callback function that will be called when the WebSocket connection is initiated. A [Socket](https://grafana.com/docs/k6//javascript-api/k6-ws/socket) object will be passed to the function, and this object can be used to set up callbacks etc when things happen on the WebSocket connection | @@ -39,7 +39,7 @@ The following events can close the connection: import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const resp = ws.connect(url, null, function (socket) { socket.on('open', function () { console.log('WebSocket connection established!'); diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/params.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/params.md index 6599172648..16711387ec 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/params.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/params.md @@ -28,7 +28,7 @@ _A k6 script that will make a WebSocket request with a custom header and tag res import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { headers: { 'X-MyHeader': 'k6test' }, tags: { k6test: 'yes' }, diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/_index.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/_index.md index 8165fa0670..3120712fc7 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/_index.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/_index.md @@ -37,7 +37,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-close.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-close.md index 359e7eed1f..efeaf662b6 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-close.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-close.md @@ -21,7 +21,7 @@ Close the WebSocket connection. import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.close(); diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-on.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-on.md index a9a49e4acd..98094ed352 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-on.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-on.md @@ -32,7 +32,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-ping.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-ping.md index 88a387bdd2..ca27aba7ec 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-ping.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-ping.md @@ -17,7 +17,7 @@ Send a ping. Ping messages can be used to verify that the remote endpoint is res import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.on('pong', function () { diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-send.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-send.md index c1f6bc07d8..4959b617f6 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-send.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-send.md @@ -22,7 +22,7 @@ You can use `JSON.stringify` to convert a JSON or JavaScript values to a JSON st import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.send('my-message'); diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-setinterval.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-setinterval.md index f68bd1fb50..b1b92ead89 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-setinterval.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-setinterval.md @@ -23,7 +23,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-settimeout.md b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-settimeout.md index b23f2ebfd1..ddee5b274a 100644 --- a/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-settimeout.md +++ b/docs/sources/k6/v1.1.x/javascript-api/k6-ws/socket/socket-settimeout.md @@ -24,7 +24,7 @@ import { sleep } from 'k6'; export default function () { console.log('T0: Script started'); - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { console.log('T0: Entered WebSockets run loop'); socket.setTimeout(function () { diff --git a/docs/sources/k6/v1.1.x/using-k6/protocols/websockets.md b/docs/sources/k6/v1.1.x/using-k6/protocols/websockets.md index 97dfdcb83b..ecb1b03fd3 100644 --- a/docs/sources/k6/v1.1.x/using-k6/protocols/websockets.md +++ b/docs/sources/k6/v1.1.x/using-k6/protocols/websockets.md @@ -33,7 +33,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -65,7 +65,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -97,7 +97,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -132,7 +132,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -164,7 +164,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/connect.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/connect.md index be9761fed5..bd61160b61 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/connect.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/connect.md @@ -21,7 +21,7 @@ The following events can close the connection: | Parameter | Type | Description | | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| url | string | Request URL (e.g. "ws://echo.websocket.org"). | +| url | string | Request URL (e.g. "wss://echo.websocket.org"). | | params | object | [Params](https://grafana.com/docs/k6//javascript-api/k6-ws/params) object containing additional request parameters. | | callback | function | The callback function that will be called when the WebSocket connection is initiated. A [Socket](https://grafana.com/docs/k6//javascript-api/k6-ws/socket) object will be passed to the function, and this object can be used to set up callbacks etc when things happen on the WebSocket connection | @@ -39,7 +39,7 @@ The following events can close the connection: import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const resp = ws.connect(url, null, function (socket) { socket.on('open', function () { console.log('WebSocket connection established!'); diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/params.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/params.md index 6599172648..16711387ec 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/params.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/params.md @@ -28,7 +28,7 @@ _A k6 script that will make a WebSocket request with a custom header and tag res import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { headers: { 'X-MyHeader': 'k6test' }, tags: { k6test: 'yes' }, diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/_index.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/_index.md index 8165fa0670..3120712fc7 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/_index.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/_index.md @@ -37,7 +37,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-close.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-close.md index 359e7eed1f..efeaf662b6 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-close.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-close.md @@ -21,7 +21,7 @@ Close the WebSocket connection. import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.close(); diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-on.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-on.md index a9a49e4acd..98094ed352 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-on.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-on.md @@ -32,7 +32,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-ping.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-ping.md index 88a387bdd2..ca27aba7ec 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-ping.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-ping.md @@ -17,7 +17,7 @@ Send a ping. Ping messages can be used to verify that the remote endpoint is res import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.on('pong', function () { diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-send.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-send.md index c1f6bc07d8..4959b617f6 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-send.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-send.md @@ -22,7 +22,7 @@ You can use `JSON.stringify` to convert a JSON or JavaScript values to a JSON st import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.send('my-message'); diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-setinterval.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-setinterval.md index f68bd1fb50..b1b92ead89 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-setinterval.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-setinterval.md @@ -23,7 +23,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-settimeout.md b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-settimeout.md index b23f2ebfd1..ddee5b274a 100644 --- a/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-settimeout.md +++ b/docs/sources/k6/v1.2.x/javascript-api/k6-ws/socket/socket-settimeout.md @@ -24,7 +24,7 @@ import { sleep } from 'k6'; export default function () { console.log('T0: Script started'); - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { console.log('T0: Entered WebSockets run loop'); socket.setTimeout(function () { diff --git a/docs/sources/k6/v1.2.x/using-k6/protocols/websockets.md b/docs/sources/k6/v1.2.x/using-k6/protocols/websockets.md index 97dfdcb83b..ecb1b03fd3 100644 --- a/docs/sources/k6/v1.2.x/using-k6/protocols/websockets.md +++ b/docs/sources/k6/v1.2.x/using-k6/protocols/websockets.md @@ -33,7 +33,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -65,7 +65,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -97,7 +97,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -132,7 +132,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -164,7 +164,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/connect.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/connect.md index be9761fed5..ac99c7bf8e 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/connect.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/connect.md @@ -11,7 +11,7 @@ weight: 10 Initiate a WebSocket connection to a remote host. -Calling connect will block the VU finalization until the WebSocket connection is closed. Instead of continuously looping the main function (`export default function() { ... }`) over an over, each VU will be halted listening to async events and executing their event handlers until the connection is closed. +Calling connect will block the VU finalization until the WebSocket connection is closed. Instead of continuously looping the main function (`export default function () { ... }`) over an over, each VU will be halted listening to async events and executing their event handlers until the connection is closed. The following events can close the connection: @@ -21,7 +21,7 @@ The following events can close the connection: | Parameter | Type | Description | | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| url | string | Request URL (e.g. "ws://echo.websocket.org"). | +| url | string | Request URL (e.g. "wss://echo.websocket.org"). | | params | object | [Params](https://grafana.com/docs/k6//javascript-api/k6-ws/params) object containing additional request parameters. | | callback | function | The callback function that will be called when the WebSocket connection is initiated. A [Socket](https://grafana.com/docs/k6//javascript-api/k6-ws/socket) object will be passed to the function, and this object can be used to set up callbacks etc when things happen on the WebSocket connection | @@ -39,7 +39,7 @@ The following events can close the connection: import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const resp = ws.connect(url, null, function (socket) { socket.on('open', function () { console.log('WebSocket connection established!'); diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/params.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/params.md index 6599172648..16711387ec 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/params.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/params.md @@ -28,7 +28,7 @@ _A k6 script that will make a WebSocket request with a custom header and tag res import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { headers: { 'X-MyHeader': 'k6test' }, tags: { k6test: 'yes' }, diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/_index.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/_index.md index 8165fa0670..3120712fc7 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/_index.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/_index.md @@ -37,7 +37,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-close.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-close.md index 359e7eed1f..efeaf662b6 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-close.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-close.md @@ -21,7 +21,7 @@ Close the WebSocket connection. import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.close(); diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-on.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-on.md index a9a49e4acd..98094ed352 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-on.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-on.md @@ -32,7 +32,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-ping.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-ping.md index 88a387bdd2..ca27aba7ec 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-ping.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-ping.md @@ -17,7 +17,7 @@ Send a ping. Ping messages can be used to verify that the remote endpoint is res import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.on('pong', function () { diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-send.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-send.md index c1f6bc07d8..4959b617f6 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-send.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-send.md @@ -22,7 +22,7 @@ You can use `JSON.stringify` to convert a JSON or JavaScript values to a JSON st import ws from 'k6/ws'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { socket.on('open', function () { socket.send('my-message'); diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-setinterval.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-setinterval.md index f68bd1fb50..b1b92ead89 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-setinterval.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-setinterval.md @@ -23,7 +23,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { diff --git a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-settimeout.md b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-settimeout.md index b23f2ebfd1..ddee5b274a 100644 --- a/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-settimeout.md +++ b/docs/sources/k6/v1.3.x/javascript-api/k6-ws/socket/socket-settimeout.md @@ -24,7 +24,7 @@ import { sleep } from 'k6'; export default function () { console.log('T0: Script started'); - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const response = ws.connect(url, null, function (socket) { console.log('T0: Entered WebSockets run loop'); socket.setTimeout(function () { diff --git a/docs/sources/k6/v1.3.x/using-k6/http-debugging.md b/docs/sources/k6/v1.3.x/using-k6/http-debugging.md index 8d0d28e5d3..a0fcdaeea9 100644 --- a/docs/sources/k6/v1.3.x/using-k6/http-debugging.md +++ b/docs/sources/k6/v1.3.x/using-k6/http-debugging.md @@ -22,7 +22,7 @@ Given the following script: ```javascript import http from "k6/http"; -export default function() { +export default function () { http.get("https://google.com/"); } ``` diff --git a/docs/sources/k6/v1.3.x/using-k6/protocols/websockets.md b/docs/sources/k6/v1.3.x/using-k6/protocols/websockets.md index 97dfdcb83b..c01715acd5 100644 --- a/docs/sources/k6/v1.3.x/using-k6/protocols/websockets.md +++ b/docs/sources/k6/v1.3.x/using-k6/protocols/websockets.md @@ -22,7 +22,7 @@ Currently, it's available as an experimental module [`k6/experimental/websockets {{< /admonition >}} Comparing HTTP-based tests to WebSocket ones, you'll find differences in both structure and inner workings. -The primary difference is that instead of continuously looping the main function (`export default function() { ... }`) over and over, each VU is now runs an asynchronous event loop. +The primary difference is that instead of continuously looping the main function (`export default function () { ... }`) over and over, each VU is now runs an asynchronous event loop. The basic structure of a WebSocket test looks like this: @@ -33,7 +33,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -65,7 +65,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -97,7 +97,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -132,7 +132,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const res = ws.connect(url, params, function (socket) { @@ -164,7 +164,7 @@ import ws from 'k6/ws'; import { check } from 'k6'; export default function () { - const url = 'ws://echo.websocket.org'; + const url = 'wss://echo.websocket.org'; const params = { tags: { my_tag: 'hello' } }; const response = ws.connect(url, params, function (socket) {