Skip to content

Add documentation about Artillery 'connect', to authenticate a socket connection #490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/categories/06-Advanced/load-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ To run this scenario:
$ npx artillery run my-scenario.yml
```

You can use `connect` to customize handshake request. Here is an example to pass a session cookie:

```yaml
scenarios:
- name: My sample scenario
engine: socketio-v3
flow:
# Login
- post:
url: "/api/auth"
capture:
- header: "set-cookie"
as: "userCookie"

# Authenticate socket io connection
- connect:
extraHeaders:
Cookie: "{{ userCookie[0] }}"
```

Artillery also comes with a lot of awesome features, like the ability to [publish the metrics to various endpoints](https://artillery.io/docs/guides/plugins/plugin-publish-metrics.html) or [run the tests from AWS](https://artillery.io/docs/guides/guides/running-tests-with-artillery-pro.html).

Its only limitation is that you cannot easily test server-to-client events, as the Artillery DSL is more suited for classic client-to-server communication. Which brings us to [our next section](#manual-client-creation).
Expand Down