Artillery: Use payload with websocket target

Created on 8 Mar 2019  路  8Comments  路  Source: artilleryio/artillery

Hi there!

Is it possible to use payload to customize target URL in Websocket ?

I'm trying to use this config:

config:
  payload:
    path: "users.csv"
    fields:
      - "access_token"
      - "login"
    skipHeader: true
  target: 'wss://localhost/websocket?auth={{ access_token }}'
  tls:
    rejectUnauthorized: false
  phases:
    - duration: 200
      arrivalRate: 1
scenarios:
  - engine: 'ws'
    flow:
      - think: 100

with the following CSV:

"access_token","login"
"A test token","Rykian"

But my auth param on server side is always undefined

ws enhancement

Most helpful comment

Not possible at the moment, as target is set once for all virtual users. What we need to do is to add a connect action in the WebSocket engine, which can be used for custom connection parameters. Thanks for opening the issue @Rykian!

All 8 comments

Not possible at the moment, as target is set once for all virtual users. What we need to do is to add a connect action in the WebSocket engine, which can be used for custom connection parameters. Thanks for opening the issue @Rykian!

I have this "issue" too. Is there any chance to develop this feature?

@hassy How to achive this ?

@hassy I need a solution as soon as possible. @Rykian and @thiagosan How you achive this ?

I didn't used artillery: I wrote a custom script from scratch.

@Rykian Can you share that script with me

I can't, my client paid me for it, he is the owner of the code. But your GitHub profile seems to show that your are an accomplished developer, read the doc of websocket client and get a lib to read a CSV in whatever language you like and code it yourself :)

This is still an issue for me, please update once it is resolved.

Was this page helpful?
0 / 5 - 0 ratings