secure_tls_client.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #
  3. # This is an example of a script to run a "secure" TURN TLS client
  4. # with the long-term credentials mechanism.
  5. #
  6. # Options:
  7. #
  8. # 1) -t is present, it means that TCP networking is used.
  9. # 2) -S means "SSL/TLS protocol with default cipher".
  10. # 3) -i absent.
  11. # 4) -k sets private key file for TLS.
  12. # 5) -n 1000 means 1000 messages per single emulated client. Messages
  13. # are sent with interval of 20 milliseconds, to emulate an RTP stream.
  14. # 6) -m 10 means that 10 clients are emulated.
  15. # 7) -l 170 means that the payload size of the packets is 170 bytes
  16. # (like average audio RTP packet).
  17. # 8) -e 127.0.0.1 means that the clients will use peer address 127.0.0.1.
  18. # 9) -g means "set DONT_FRAGMENT parameter in TURN requests".
  19. # 10) -u gorst means that if the server challenges the client with
  20. # authentication challenge, then we use account "gorst".
  21. # 11) -w hero sets the password for the account as "hero".
  22. # 12) -s option means that the client will be using "send" mechanism for data.
  23. # 13) ::1 (the last parameter) is the TURN Server IP address. We use IPv6 here
  24. # to illustrate how the TURN Server convert the traffic from IPv6 to IPv4 and back.
  25. #
  26. if [ -d examples ] ; then
  27. cd examples
  28. fi
  29. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/
  30. PATH=examples/bin/:../bin:./bin/:${PATH} turnutils_uclient -t -S -k turn_client_pkey.pem -n 1000 -m 10 -l 170 -e 127.0.0.1 -X -g -u gorst -w hero $@ ::1