secure_udp_client_short_term.sh 1.3 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. #
  3. # This is an example of a script to run a "secure" TURN UDP client
  4. # with short-term credential mechanism.
  5. #
  6. # Options:
  7. #
  8. # 1) -t is absent, it means that UDP networking is used.
  9. # 5) -n 1000 means 1000 messages per single emulated client. Messages
  10. # are sent with interval of 20 milliseconds, to emulate an RTP stream.
  11. # 6) -m 10 means that 10 clients are emulated.
  12. # 7) -l 170 means that the payload size of the packets is 170 bytes
  13. # (like average audio RTP packet).
  14. # 8) -e 127.0.0.1 means that the clients will use peer address 127.0.0.1.
  15. # 9) -g means "set DONT_FRAGMENT parameter in TURN requests".
  16. # 10) -A means that the short-term credentials mechanism is used.
  17. # 11) -u ninefingers sets the client user name.
  18. # 12) -w youhavetoberealistic sets the password for the user account as "youhavetoberealistic".
  19. # 13) -s option means that the client will be using "send" indication for data trasfer.
  20. # 14) ::1 (the last parameter) is the TURN Server IP address. We use IPv6 here
  21. # to illustrate how the TURN Server convert the traffic from IPv6 to IPv4 and back.
  22. #
  23. if [ -d examples ] ; then
  24. cd examples
  25. fi
  26. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/
  27. PATH=examples/bin/:../bin/:./bin/:${PATH} turnutils_uclient -n 1000 -m 10 -l 170 -e 127.0.0.1 -X -g -A -u ninefingers -w youhavetoberealistic -s $@ ::1