master_relay.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. #
  3. # This is an example of a MASTER TURN server that distributes
  4. # the load among several "slave" TURN servers.
  5. #
  6. # The TURN Server is started in
  7. # secure mode (when authentication is used) - see option -a
  8. # that means "use long-term credential mechanism".
  9. #
  10. # We start here a TURN Server listening on IPv4 address
  11. # 127.0.0.1. We use 127.0.0.1 as the relay address, too.
  12. #
  13. # Other options:
  14. #
  15. # 1) set bandwidth limit on client session 3000000 bytes per second (--max-bps).
  16. # 2) use fingerprints (-f)
  17. # 3) use 3 relay threads (-m 3)
  18. # 4) use min UDP relay port 32355 and max UDP relay port 65535
  19. # 5) "-r north.gov" means "use authentication realm north.gov"
  20. # 6) "--user=ninefingers:0xbc807ee29df3c9ffa736523fb2c4e8ee" means
  21. # "allow user 'ninefinger' with generated key '0xbc807ee29df3c9ffa736523fb2c4e8ee' ".
  22. # 7) "--user=gorst:hero" means "allow user 'gorst' with password 'hero' ".
  23. # 8) "--log-file=stdout" means that all log output will go to the stdout.
  24. # 9) "-v" means normal verbose mode (with some moderate logging).
  25. # 10) --no-dtls and --no-tls measn that we are not using DTLS & TLS protocols here
  26. # (for the sake of simplicity).
  27. # 11) --alternate-server options set the "slave" servers.
  28. # 12) --cli-password=secret means that cli password set to "secret"
  29. # Other parameters (config file name, etc) are default.
  30. if [ -d examples ] ; then
  31. cd examples
  32. fi
  33. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  34. export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  35. PATH="./bin/:../bin/:../../bin/:${PATH}" turnserver --syslog -a -L 127.0.0.1 -E 127.0.0.1 --allow-loopback-peers --max-bps=3000000 -f -m 3 --min-port=32355 --max-port=65535 --user=ninefingers:0xbc807ee29df3c9ffa736523fb2c4e8ee --user=gorst:hero -r north.gov --log-file=stdout -v --no-dtls --no-tls --alternate-server=127.0.0.1:3333 --alternate-server=127.0.0.1:4444 --cli-password=secret $@