processone / tsung

Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc.
http://www.process-one.net/en/tsung/
GNU General Public License v2.0
2.55k stars 407 forks source link

how to use protobuffer in websocket #255

Open huang2287832 opened 7 years ago

huang2287832 commented 7 years ago

I use websocket to test myproject , but I dont know how to edit xml in protobuffer , please help, thanks

tisba commented 6 years ago

Since protobuf is a binary format, directly editing this in Tsung's XML configuration is not really an option.

I don't really see an easy option here, aport from writing some Erlang code yourself to generate protobuf messages on-the-fly. An alternative for generating the entire protobuf messages could be to base64 encode them and use base64:decode/1 to decode them (also Erlang code, but a lot less complex). This will only work though if your message is static.

fatso83 commented 4 years ago

You can always just dump the protobuf contents to a file and POST that using the contents_from_file attribute.