ptejada / artillery-engine-socketio-v3

Socket.IO v3 engine for Artillery
Mozilla Public License 2.0
22 stars 15 forks source link

How to pass extraHeaders to scenario #4

Closed maitrungduc1410 closed 3 years ago

maitrungduc1410 commented 3 years ago

Hi @ptejada ,

I'm trying to pass extra headers by using:

scenarios:
  - engine: socketio-v3
    socketio:
      extraHeaders:
        Cookie: "test=123456"
....

But this is not working, console.log from server-side always returns undefined

Do you have any idea on this?

Thank you

ptejada commented 3 years ago

@maitrungduc1410 I don't think this is an scenario that it is supported at the scenario flow level at the moment. You can can configure the client configuration from the config.engines.socketio-v3 which will apply to all connections made. Ex:

config:
  target: "http://localhost:3000"
  phases:
    - duration: 30
      arrivalRate: 5
  engines:
   socketio-v3: 
     extraHeaders:
       Cookie: "test=123456"
scenarios:
  ...
maitrungduc1410 commented 3 years ago

thanks for your response

Gerben-T commented 2 years ago

So we are not able to set headers dynamically? Like calling a config.processor script. I can't seem to call it from the config section so i'm not able to set a dynamic value for a specific header/socketio option..