1
0

secure_relay.sh 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. #
  3. # This is an example how to start a TURN Server
  4. # with self-udp-balancing, in secure mode
  5. # (when authentication is used) - see option -a
  6. # that means "use long-term credential mechanism".
  7. #
  8. # We start here a TURN Server listening on IPv4 address
  9. # 127.0.0.1 and on IPv6 address ::1. We use 127.0.0.1 as
  10. # IPv4 relay address, and we use ::1 as IPv6 relay address.
  11. #
  12. # Other options:
  13. #
  14. # 1) --aux-server=... options start two auxiliary severs on IP address 127.0.0.1
  15. # and ports 12345 and 12346, and two auxiliary servers on IP adress ::1
  16. # with the same ports.
  17. # 2) --self-udp-balance option forces the server to distribute the load from the
  18. # main server points to the auxiliary servers through the ALTERNATE-SERVER
  19. # mechanism.
  20. # 3) set bandwidth limit on client session 3000000 bytes per second (--max-bps).
  21. # 4) use fingerprints (-f)
  22. # 5) use 10 relay threads (-m 10)
  23. # 6) use min UDP relay port 32355 and max UDP relay port 65535
  24. # 7) "-r north.gov" means "use authentication realm north.gov"
  25. # 8) "--user=ninefingers:youhavetoberealistic" means
  26. # "allow user 'ninefinger' with password 'youhavetoberealistic' ".
  27. # 9) "--user=gorst:hero" means "allow user 'gorst' with password 'hero' ".
  28. # 10) "--cert=example_turn_server_cert.pem" sets the OpenSSL certificate file name.
  29. # 11) "--pkey=example_turn_server_pkey.pem" sets the OpenSSL private key name.
  30. # 12) "--log-file=stdout" means that all log output will go to the stdout.
  31. # 13) "-v" means normal verbose mode (with some moderate logging).
  32. # 14) --cipher-list=ALL means that we support all OpenSSL ciphers
  33. # 15) --cli-password=secret means that cli password set to "secret"
  34. # Other parameters (config file name, etc) are default.
  35. if [ -d examples ] ; then
  36. cd examples
  37. fi
  38. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  39. export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  40. PATH="./bin/:../bin/:../../bin/:${PATH}" turnserver --aux-server=127.0.0.1:12345 --aux-server=[::1]:12345 --aux-server=127.0.0.1:12346 --aux-server=[::1]:12346 --udp-self-balance --syslog -a -L 127.0.0.1 -L ::1 -E 127.0.0.1 -E ::1 --allow-loopback-peers --max-bps=3000000 -f -m 10 --min-port=32355 --max-port=65535 --user=ninefingers:youhavetoberealistic --user=gorst:hero -r north.gov --cert=turn_server_cert.pem --pkey=turn_server_pkey.pem --log-file=stdout --cipher-list=ALL --db=var/db/turndb --cli-password=secret $@