testillano / h2agent

C++ HTTP/2 Mock Service which enables mocking HTTP/2 applications (also HTTP/1 supported).
Other
10 stars 0 forks source link

Allow patterns random set in udp-client #100

Closed testillano closed 1 year ago

testillano commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, upd-client generates UDP datagrams parsing sequence for a given range, over a pattern, fixed or not (@{seq} for sequence). We would like to improve the client allowing to specify a set of patterns so they are selected randomly between the set provided.

Describe the solution you'd like Allow multiple --pattern parameter, for example: --pattern AAA --pattern "BBB|@{seq}"

In this case, the pattern selected will by aproximately 50% any of them. Finally it is parsed.

This allow, for example to generate a valid or invalid datagram for otherapplication (udp-server-h2client):

--pattern "/invalid/path/" --pattern "/foo/bar/@{seq}" --pattern "/foo/bar/@{seq}"

This example provides about 66% of valid URIs to be sent as datagrams.