secure_relay_secret.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. #
  3. # This is an example how to start a TURN Server in
  4. # secure 'static' 'secret' mode (see TURNServerRESTAPI.pdf)
  5. # with the long-term credentials mechanism.
  6. #
  7. # We start here a TURN Server listening on IPv4 address
  8. # 127.0.0.1 and on IPv6 address ::1. We use 127.0.0.1 as
  9. # IPv4 relay address, and we use ::1 as IPv6 relay address.
  10. #
  11. # Other options:
  12. #
  13. # 1) set bandwidth limit on client session 3000000 bytes per second (--max-bps).
  14. # 2) use fingerprints (-f)
  15. # 3) use 3 relay threads (-m 3)
  16. # 4) use min UDP relay port 32355 and max UDP relay port 65535
  17. # 5) --use-auth-secret means that we are using 'secret' authentication mode.
  18. # 6) --static-auth-secret=logen means that we will be using 'static' secret value.
  19. # 7) --realm=north.gov sets realm value as "north.gov".
  20. # 8) "--cert=example_turn_server_cert.pem" sets the OpenSSL certificate file name.
  21. # 9) "--pkey=example_turn_server_pkey.pem" sets the OpenSSL private key name.
  22. # 10) "--log-file=stdout" means that all log output will go to the stdout.
  23. # 11) "-q 100" means that single user can create no more than 100 sessions
  24. # 12) "-Q 300" means that there may be no more than 300 sessions totally
  25. # 13) --cipher-list=ALL means that we support all OpenSSL ciphers
  26. # Other parameters (config file name, etc) are default.
  27. if [ -d examples ] ; then
  28. cd examples
  29. fi
  30. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  31. export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  32. PATH="./bin/:../bin/:../../bin/:${PATH}" turnserver -v --syslog -a -L 127.0.0.1 -L ::1 -E 127.0.0.1 -E ::1 --max-bps=3000000 -f -m 3 --min-port=32355 --max-port=65535 --use-auth-secret --static-auth-secret=logen --realm=north.gov --cert=turn_server_cert.pem --pkey=turn_server_pkey.pem --log-file=stdout -q 100 -Q 300 --cipher-list=ALL $@