observing / thor

The WebSocket god of thunder
MIT License
1.29k stars 154 forks source link

Generator <file.js> #32

Open patoigz opened 8 years ago

patoigz commented 8 years ago

I can't create a "file.js" without errors. Could you please include an example of this file...

Thank you.

luposlip commented 7 years ago

I made it work by adding --masked (don't really know what it does):

thor --masked --amount 100 --messages 10 --generator ./test/msg-generator.js "ws://localhost:8080/async

Furthermore I changed the second last line in the generators utf8 function to include the actual data to be sent (should be dynamically generated of course):

cached = cache[key] = new Buffer('+[["~:data",["^ ","~:message-id","~uf632fcc0-7b7d-4282-9113-2e18459ae12c","~:payload",["^ ","~:q","","~:lat",12.66584,"~:lon",20.566247]]]]', "utf-8");