vegeta icon indicating copy to clipboard operation
vegeta copied to clipboard

How to send dependent requests

Open maxtar opened this issue 3 years ago • 4 comments

Hi.

I couldn't understand how I can use response from one request in another one? For example the following scenario:

  1. Do request for authorization.
  2. Get token from answer.
  3. Use this token in the next request.

I couldn't use dynamic targeter in attacker. How I can implement such a scenario?

maxtar avatar May 21 '21 08:05 maxtar

Hi

I'm looking for the same answer, any luck implenting it ?

rgarrigue avatar Aug 20 '21 10:08 rgarrigue

@maxtar I'm afraid that there's only one solution -- use vegeta as library and embed it's logic in your own go code

flupec avatar Dec 01 '21 12:12 flupec

@flupec

use vegeta as library and embed it's logic in your own go code

The question has occurred to me exactly because I started to write code. :)

maxtar avatar Dec 01 '21 12:12 maxtar

@maxtar I guess vegeta not designed for such case. You can try to init three different attackers for each step from scenario above. First attacker will make authorization and return chan of result. This chan of result will be an input for second attacker and so on. In that case you will need different implementation for Targeter function. Try to research by yourself :) But there's no guarantee of performance, it will depend on your implementation of this

flupec avatar Dec 01 '21 13:12 flupec

You isn't really designed for this use case, but you can indeed try to hack it by reading results from one attack into the targeter of the next attack.

tsenart avatar Jul 18 '23 21:07 tsenart