The variables need to be exposed through a function, as the CLI has to
copy the elements defined by Talkbuchet.js to the global scope when
loading it, but if a variable is later overwritten the copied one would
not reflect it.
Note that CLI does not directly use the exposed publishers, subscribers
and virtual participants; they are just exposed in case they need to be
used by custom scripts.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Siege and virtual participant modes are independent one from the other,
so at any given time the CLI only provides the global functions that
belong to the mode currently active. By default the CLI starts in siege
mode.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
In the virtual participant mode Talkbuchet can be used to add
participants to a call and thus perform load test in clients. Virtual
participants require much less resources than real participants in the
system running Talkbuchet, so it makes possible to add a lot more
participants than what would be possible with real participants.
Note, however, that a single browser can run just a single virtual
participant. Therefore, virtual participants are recommended to be used
through the CLI (the support will be introduced in a following commit).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Automatically joining the room after getting the "hello" message is
needed only for guest users. However, sieges as guest users are not
possible, as joining the room a second time from the same browser causes
the first guest to be unregistered. Due to this the code to
automatically join the room is removed.
The method to join the room, however, is kept, as it will be used by the
"Virtual participant" mode to be introduced in a later commit.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This makes possible to identify which connection has a problem and
further investigate it if desired.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Starting tens or hundreds of connections may take a while, so the
progress is now printed to prevent the user from wondering if it is
working or not.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This ensures that if media can not be started again for some reason (for
example, if neither audio nor video are now enabled) the old stream will
not be kept.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Talkbuchet is a JavaScript script meant to be loaded and run in a
browser. However, until now that required manually copying and pasting
the script in a browser console. This commit adds a Python script that
uses Selenium to launch a new browser, load Talkbuchet in it and control
it through the Python script.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Until now the script had to be edited to set the right configuration
parameters and then copied and pasted on the browser console; running
the script again required reloading the page and pasting it again, even
if the parameters where not modified. Now the constants were changed to
variables and helper functions were added to set them, so the script can
be pasted without changes and the configuration can be adjusted by
calling the helper functions. Moreover, as there is now an explicit
function to start the siege the script can be run several times and with
different parameters without having to reload the page and paste it
again.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>