secure_tls_client_c2c_tcp_relay.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  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 and with
  5. # TCP relay endpoints (RFC 6062).
  6. #
  7. # Options:
  8. #
  9. # 1) -T is present, it means that TCP networking is used, with TCP
  10. # relay endpoints (RFC 6062.
  11. # 2) -S means that "secure protocol", that is TLS in the case of TCP,
  12. # will be used between the client and the TURN Server.
  13. # 3) -i absent.
  14. # 4) -k sets private key file for TLS.
  15. # 5) -n 1000 means 1000 messages per single emulated client. Messages
  16. # are sent with interval of 20 milliseconds, to emulate an RTP stream.
  17. # 6) -m 10 means that 10 clients are emulated.
  18. # 7) -l 170 means that the payload size of the packets is 170 bytes
  19. # (like average audio RTP packet).
  20. # 8) -y means that the clients will connect to the 'neighbor' clients, no peer app will be used.
  21. # 9) -g means "set DONT_FRAGMENT parameter in TURN requests".
  22. # 10) -u gorst means that if the server challenges the client with
  23. # authentication challenge, then we use account "gorst".
  24. # 11) -w hero sets the password for the account as "hero".
  25. # 12) ::1 (the last parameter) is the TURN Server IP address. We use IPv6 here
  26. # to illustrate how the TURN Server convert the traffic from IPv6 to IPv4 and back.
  27. #
  28. if [ -d examples ] ; then
  29. cd examples
  30. fi
  31. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/postgres/9.2-pgdg/lib
  32. PATH=examples/bin/:../bin:./bin/:${PATH} turnutils_uclient -T -S -k turn_client_pkey.pem -n 1000 -m 10 -l 170 -y -g -u gorst -w hero $@ ::1