turnserver.1 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210
  1. .\" Text automatically generated by txt2man
  2. .TH TURN 1 "25 September 2016" "" ""
  3. .SH GENERAL INFORMATION
  4. The \fBTURN Server\fP project contains the source code of a TURN server and TURN client
  5. messaging library. Also, some extra programs provided, for testing\-only
  6. purposes.
  7. .PP
  8. See the INSTALL file for the building instructions.
  9. .PP
  10. After the build, you will have the following binary images:
  11. .TP
  12. .B
  13. 1.
  14. \fIturnserver\fP: \fBTURN Server\fP relay.
  15. The compiled binary image of the \fBTURN Server\fP program is located in bin/ sub\-directory.
  16. .TP
  17. .B
  18. 2.
  19. \fIturnadmin\fP: TURN administration tool. See README.turnadmin and \fIturnadmin\fP man page.
  20. .TP
  21. .B
  22. 3.
  23. turnutils_uclient. See README.turnutils and \fIturnutils\fP man page.
  24. .TP
  25. .B
  26. 4.
  27. turnutils_peer. See README.turnutils and \fIturnutils\fP man page.
  28. .TP
  29. .B
  30. 5.
  31. turnutils_stunclient. See README.turnutils and \fIturnutils\fP man page.
  32. .TP
  33. .B
  34. 6.
  35. turnutils_rfc5769check. See README.turnutils and \fIturnutils\fP man page.
  36. .PP
  37. In the "examples/scripts" sub\-directory, you will find the examples of command lines to be used
  38. to run the programs. The scripts are meant to be run from examples/ sub\-directory, for example:
  39. .PP
  40. $ cd examples
  41. $ ./scripts/secure_relay.sh
  42. .SH RUNNING THE TURN SERVER
  43. Options note: \fIturnserver\fP has long and short option names, for most options.
  44. Some options have only long form, some options have only short form. Their syntax
  45. somewhat different, if an argument is required:
  46. .PP
  47. The short form must be used as this (for example):
  48. .PP
  49. .nf
  50. .fam C
  51. $ turnserver \-L 12.34.56.78
  52. .fam T
  53. .fi
  54. The long form equivalent must use the "=" character:
  55. .PP
  56. .nf
  57. .fam C
  58. $ turnserver \-\-listening\-ip=12.34.56.78
  59. .fam T
  60. .fi
  61. If this is a flag option (no argument required) then their usage are the same, for example:
  62. .PP
  63. .nf
  64. .fam C
  65. $ turnserver \-a
  66. .fam T
  67. .fi
  68. is equivalent to:
  69. .PP
  70. .nf
  71. .fam C
  72. $ turnserver \-\-lt\-cred\-mech
  73. .fam T
  74. .fi
  75. =====================================
  76. .SS NAME
  77. \fB
  78. \fBturnserver \fP\- a TURN relay server implementation.
  79. \fB
  80. .SS SYNOPSIS
  81. .nf
  82. .fam C
  83. $ \fIturnserver\fP [\fB\-n\fP | \fB\-c\fP <config\-file> ] [\fIflags\fP] [ \fB\-\-userdb\fP=<userdb\-file> | \fB\-\-psql\-userdb\fP=<db\-conn\-string> | \fB\-\-mysql\-userdb\fP=<db\-conn\-string> | \fB\-\-mongo\-userdb\fP=<db\-conn\-string> | \fB\-\-redis\-userdb\fP=<db\-conn\-string> ] [\fB\-z\fP | \fB\-\-no\-auth\fP | \fB\-a\fP | \fB\-\-lt\-cred\-mech\fP ] [\fIoptions\fP]
  84. $ \fIturnserver\fP \fB\-h\fP
  85. .fam T
  86. .fi
  87. .fam T
  88. .fi
  89. .SS DESCRIPTION
  90. .TP
  91. .B
  92. Config file settings:
  93. .TP
  94. .B
  95. \fB\-n\fP
  96. Do not use configuration file, use only command line parameters.
  97. .TP
  98. .B
  99. \fB\-c\fP
  100. Configuration file name (default \- turnserver.conf).
  101. The format of config file can be seen in
  102. the supplied examples/etc/turnserver.conf example file. Long
  103. names of the \fIoptions\fP are used as the configuration
  104. items names in the file. If not an absolute path is supplied,
  105. then the file is searched in the following directories:
  106. .RS
  107. .IP \(bu 3
  108. current directory
  109. .IP \(bu 3
  110. current directory etc/ sub\-directory
  111. .IP \(bu 3
  112. upper directory level etc/
  113. .IP \(bu 3
  114. /etc/
  115. .IP \(bu 3
  116. /usr/local/etc/
  117. .IP \(bu 3
  118. installation directory /etc
  119. .RE
  120. .TP
  121. .B
  122. User database settings:
  123. .TP
  124. .B
  125. \fB\-b\fP, \fB\-\-db\fP, \fB\-\-userdb\fP
  126. SQLite user database file name (default \- /var/db/turndb or
  127. /usr/local/var/db/turndb or /var/lib/turn/turndb).
  128. .TP
  129. .B
  130. \fB\-e\fP, \fB\-\-psql\-userdb\fP
  131. User database connection string for PostgreSQL.
  132. This database can be used for long\-term credentials mechanism,
  133. and it can store the secret value
  134. for secret\-based timed authentication in TURN RESP API.
  135. The connection string format is like that:
  136. .RS
  137. .PP
  138. "host=<host> dbname=<dbname> user=<db\-user> password=<db\-user\-password> connect_timeout=<seconds>"
  139. (for 8.x or newer Postgres).
  140. .PP
  141. Or:
  142. .PP
  143. "postgresql://username:password@hostname:port/databasename"
  144. (for 9.x or newer Postgres).
  145. .PP
  146. See the INSTALL file for more explanations and examples.
  147. .PP
  148. Also, see http://www.PostgreSQL.org for full PostgreSQL documentation.
  149. .RE
  150. .TP
  151. .B
  152. \fB\-M\fP, \fB\-\-mysql\-userdb\fP
  153. User database connection string for MySQL or MariaDB.
  154. This database can be used for long\-term credentials mechanism,
  155. and it can store the secret value for
  156. secret\-based timed authentication in TURN RESP API.
  157. The connection string format is like that:
  158. .RS
  159. .PP
  160. "host=<host> dbname=<dbname> user=<db\-user> password=<db\-user\-password> connect_timeout=<seconds> read_timeout=<seconds>"
  161. .PP
  162. See the INSTALL file for more explanations and examples.
  163. .PP
  164. Also, see http://www.mysql.org or http://mariadb.org
  165. for full MySQL documentation.
  166. .PP
  167. Optional connection string parameters for the secure communications (SSL):
  168. ca, capath, cert, key, cipher
  169. (see http://dev.mysql.com/doc/refman/5.1/en/ssl\-options.html for the
  170. command \fIoptions\fP description).
  171. .RE
  172. .TP
  173. .B
  174. \fB\-J\fP, \fB\-\-mongo\-userdb\fP
  175. User database connection string for MongoDB.
  176. This database can be used for long\-term credentials mechanism,
  177. and it can store the secret value
  178. for secret\-based timed authentication in TURN RESP API.
  179. The connection string format is like that:
  180. .RS
  181. .PP
  182. "mongodb://username:password@host:port/database?\fIoptions\fP"
  183. .PP
  184. See the INSTALL file for more explanations and examples.
  185. .PP
  186. Also, see http://docs.mongodb.org/manual/
  187. for full MongoDB documentation.
  188. .RE
  189. .TP
  190. .B
  191. \fB\-N\fP, \fB\-\-redis\-userdb\fP
  192. User database connection string for Redis.
  193. This database can be used for long\-term credentials mechanism,
  194. and it can store the secret
  195. value for secret\-based timed authentication in TURN RESP API.
  196. The connection string format is like that:
  197. .RS
  198. .PP
  199. "ip=<ip\-addr> dbname=<db\-number> password=<db\-password> connect_timeout=<seconds>"
  200. .PP
  201. See the INSTALL file for more explanations and examples.
  202. .PP
  203. Also, see http://redis.io for full Redis documentation.
  204. .RE
  205. .TP
  206. .B
  207. Flags:
  208. .TP
  209. .B
  210. \fB\-v\fP, \fB\-\-verbose\fP
  211. Moderate verbose mode.
  212. .TP
  213. .B
  214. \fB\-V\fP, \fB\-\-Verbose\fP
  215. Extra verbose mode, very annoying and not recommended.
  216. .TP
  217. .B
  218. \fB\-o\fP, \fB\-\-daemon\fP
  219. Run server as daemon.
  220. .TP
  221. .B
  222. \fB\-f\fP, \fB\-\-fingerprint\fP
  223. Use fingerprints in the TURN messages. If an incoming request
  224. contains a fingerprint, then TURN server will always add
  225. fingerprints to the messages in this session, regardless of the
  226. per\-server setting.
  227. .TP
  228. .B
  229. \fB\-a\fP, \fB\-\-lt\-cred\-mech\fP
  230. Use long\-term credentials mechanism (this one you need for WebRTC usage).
  231. .TP
  232. .B
  233. \fB\-z\fP, \fB\-\-no\-auth\fP
  234. Do not use any credentials mechanism, allow anonymous access.
  235. Opposite to \fB\-a\fP and \fB\-A\fP \fIoptions\fP. This is default option when no
  236. authentication\-related \fIoptions\fP are set.
  237. By default, no credential mechanism is used \-
  238. any user is allowed.
  239. .TP
  240. .B
  241. \fB\-\-use\-auth\-secret\fP
  242. TURN REST API flag.
  243. Flag that sets a special WebRTC authorization option
  244. that is based upon authentication secret. The feature purpose
  245. is to support "\fBTURN Server\fP REST API" as described in
  246. the TURN REST API section below.
  247. This option uses timestamp as part of combined username:
  248. usercombo \-> "timestamp:username",
  249. turn user \-> usercombo,
  250. turn password \-> \fBbase64\fP(hmac(input_buffer = usercombo, key = shared\-secret)).
  251. This allows TURN credentials to be accounted for a specific user id.
  252. If you don't have a suitable id, the timestamp alone can be used.
  253. This option is just turns on secret\-based authentication.
  254. The actual value of the secret is defined either by option static\-auth\-secret,
  255. or can be found in the turn_secret table in the database.
  256. .TP
  257. .B
  258. \fB\-\-oauth\fP
  259. Support oAuth authentication, as in the third\-party STUN/TURN RFC 7635.
  260. .TP
  261. .B
  262. \fB\-\-dh566\fP
  263. Use 566 bits predefined DH TLS key. Default size of the key is 1066.
  264. .TP
  265. .B
  266. \fB\-\-dh2066\fP
  267. Use 2066 bits predefined DH TLS key. Default size of the key is 1066.
  268. .TP
  269. .B
  270. \fB\-\-no\-tlsv1\fP
  271. Do not allow TLSv1/DTLSv1 protocol.
  272. .TP
  273. .B
  274. \fB\-\-no\-tlsv1_1\fP
  275. Do not allow TLSv1.1 protocol.
  276. .TP
  277. .B
  278. \fB\-\-no\-tlsv1_2\fP
  279. Do not allow TLSv1.2/DTLSv1.2 protocol.
  280. .TP
  281. .B
  282. \fB\-\-no\-udp\fP
  283. Do not start UDP client listeners.
  284. .TP
  285. .B
  286. \fB\-\-no\-tcp\fP
  287. Do not start TCP client listeners.
  288. .TP
  289. .B
  290. \fB\-\-no\-tls\fP
  291. Do not start TLS client listeners.
  292. .TP
  293. .B
  294. \fB\-\-no\-dtls\fP
  295. Do not start DTLS client listeners.
  296. .TP
  297. .B
  298. \fB\-\-no\-udp\-relay\fP
  299. Do not allow UDP relay endpoints defined in RFC 5766,
  300. use only TCP relay endpoints as defined in RFC 6062.
  301. .TP
  302. .B
  303. \fB\-\-no\-tcp\-relay\fP
  304. Do not allow TCP relay endpoints defined in RFC 6062,
  305. use only UDP relay endpoints as defined in RFC 5766.
  306. .TP
  307. .B
  308. \fB\-\-no\-stdout\-log\fP
  309. Flag to prevent stdout log messages.
  310. By default, all log messages are going to both stdout and to
  311. the configured log file. With this option everything will be going to
  312. the log file only (unless the log file itself is stdout).
  313. .TP
  314. .B
  315. \fB\-\-syslog\fP
  316. With this flag, all log will be redirected to the system log (syslog).
  317. .TP
  318. .B
  319. \fB\-\-simple\-log\fP
  320. This flag means that no log file rollover will be used, and the log file
  321. name will be constructed as\-is, without PID and date appendage.
  322. This option can be used, for example, together with the logrotate tool.
  323. .TP
  324. .B
  325. \fB\-\-secure\-stun\fP
  326. Require authentication of the STUN Binding request.
  327. By default, the clients are allowed anonymous access to the STUN Binding functionality.
  328. .TP
  329. .B
  330. \fB\-S\fP, \fB\-\-stun\-only\fP
  331. Run as STUN server only, all TURN requests will be ignored.
  332. Option to suppress TURN functionality, only STUN requests will be processed.
  333. .TP
  334. .B
  335. \fB\-\-no\-stun\fP
  336. Run as TURN server only, all STUN requests will be ignored.
  337. Option to suppress STUN functionality, only TURN requests will be processed.
  338. .TP
  339. .B
  340. \fB\-\-no\-loopback\-peers\fP
  341. Disallow peers on the loopback addresses (127.x.x.x and ::1).
  342. .TP
  343. .B
  344. \fB\-\-no\-multicast\-peers\fP
  345. Disallow peers on well\-known broadcast addresses
  346. (224.0.0.0 and above, and FFXX:*).
  347. .TP
  348. .B
  349. \fB\-\-mobility\fP
  350. Mobility with ICE (MICE) specs support.
  351. .TP
  352. .B
  353. \fB\-\-no\-cli\fP
  354. Turn OFF the CLI support. By default it is always ON.
  355. See also \fIoptions\fP \fB\-\-cli\-ip\fP and \fB\-\-cli\-port\fP.
  356. .TP
  357. .B
  358. \fB\-\-server\-relay\fP
  359. Server relay. NON\-STANDARD AND DANGEROUS OPTION.
  360. Only for those applications when we want to run
  361. server applications on the relay endpoints.
  362. This option eliminates the IP permissions check
  363. on the packets incoming to the relay endpoints.
  364. See http://tools.ietf.org/search/rfc5766#section\-17.2.3 .
  365. .TP
  366. .B
  367. \fB\-\-udp\-self\-balance\fP
  368. (recommended for older Linuxes only)
  369. Automatically balance UDP traffic over auxiliary servers
  370. (if configured). The load balancing is using the
  371. ALTERNATE\-SERVER mechanism. The TURN client must support
  372. 300 ALTERNATE\-SERVER response for this functionality.
  373. .TP
  374. .B
  375. \fB\-\-check\-origin\-consistency\fP
  376. The flag that sets the origin consistency
  377. check: across the session, all requests must have the same
  378. main ORIGIN attribute value (if the ORIGIN was
  379. initially used by the session).
  380. .TP
  381. .B
  382. \fB\-h\fP
  383. Help.
  384. .TP
  385. .B
  386. Options with values:
  387. .TP
  388. .B
  389. \fB\-\-stale\-nonce\fP[=<value>]
  390. Use extra security with nonce value having
  391. limited lifetime, in seconds (default 600 secs).
  392. .TP
  393. .B
  394. \fB\-\-max\-allocate\-lifetime\fP
  395. Set the maximum value for the allocation lifetime.
  396. Default to 3600 secs.
  397. .TP
  398. .B
  399. \fB\-\-channel\-lifetime\fP
  400. Set the lifetime for channel binding, default to 600 secs.
  401. This value MUST not be changed for production purposes.
  402. .TP
  403. .B
  404. \fB\-\-permission\-lifetime\fP
  405. Set the value for the lifetime of the permission.
  406. Default to 300 secs.
  407. This MUST not be changed for production purposes.
  408. .TP
  409. .B
  410. \fB\-d\fP, \fB\-\-listening\-device\fP
  411. Listener interface device.
  412. (NOT RECOMMENDED. Optional functionality, Linux only).
  413. The \fIturnserver\fP process must have root privileges to bind the
  414. listening endpoint to a device. If \fIturnserver\fP must run as a
  415. process without root privileges, then just do not use this setting.
  416. .TP
  417. .B
  418. \fB\-L\fP, \fB\-\-listening\-ip\fP
  419. Listener IP address of relay server.
  420. Multiple listeners can be specified, for example:
  421. \fB\-L\fP ip1 \fB\-L\fP ip2 \fB\-L\fP ip3
  422. If no \fBIP\fP(s) specified, then all IPv4 and
  423. IPv6 system IPs will be used for listening.
  424. The same \fBip\fP(s) can be used as both listening and relay \fBip\fP(s).
  425. .TP
  426. .B
  427. \fB\-p\fP, \fB\-\-listening\-port\fP
  428. TURN listener port for UDP and TCP listeners (Default: 3478).
  429. Note: actually, TLS & DTLS sessions can connect to the "plain" TCP & UDP
  430. \fBport\fP(s), too \- if allowed by configuration.
  431. .TP
  432. .B
  433. \fB\-\-tls\-listening\-port\fP
  434. TURN listener port for TLS and DTLS listeners (Default: 5349).
  435. Note: actually, "plain" TCP & UDP sessions can connect to the TLS & DTLS
  436. \fBport\fP(s), too \- if allowed by configuration. The TURN server
  437. "automatically" recognizes the type of traffic. Actually, two listening
  438. endpoints (the "plain" one and the "tls" one) are equivalent in terms of
  439. functionality; but we keep both endpoints to satisfy the RFC 5766 specs.
  440. For secure TCP connections, we currently support SSL version 3 and
  441. TLS versions 1.0, 1.1, 1.2.
  442. For secure UDP connections, we support DTLS version 1.
  443. .TP
  444. .B
  445. \fB\-\-alt\-listening\-port\fP
  446. Alternative listening port for UDP and TCP listeners;
  447. default (or zero) value means "listening port plus one".
  448. This is needed for STUN CHANGE_REQUEST \- in RFC 5780 sense
  449. or in old RFC 3489 sense \- for NAT behavior discovery). The \fBTURN Server\fP
  450. supports CHANGE_REQUEST only if it is started with more than one
  451. listening IP address of the same family (IPv4 or IPv6). The CHANGE_REQUEST
  452. is only supported by UDP protocol, other protocols are listening
  453. on that endpoint only for "symmetry".
  454. .TP
  455. .B
  456. \fB\-\-alt\-tls\-listening\-port\fP
  457. Alternative listening port for TLS and DTLS protocols.
  458. Default (or zero) value means "TLS listening port plus one".
  459. .TP
  460. .B
  461. \fB\-\-aux\-server\fP
  462. Auxiliary STUN/TURN server listening endpoint.
  463. Aux servers have almost full TURN and STUN functionality.
  464. The (minor) limitations are:
  465. .RS
  466. .IP 1) 4
  467. Auxiliary servers do not have alternative ports and
  468. they do not support STUN RFC 5780 functionality (CHANGE REQUEST).
  469. .IP 2) 4
  470. Auxiliary servers also are never returning ALTERNATIVE\-SERVER reply.
  471. .RE
  472. .PP
  473. Valid formats are 1.2.3.4:5555 for IPv4 and [1:2::3:4]:5555 for IPv6.
  474. There may be multiple aux\-server \fIoptions\fP, each will be used for listening
  475. to client requests.
  476. .TP
  477. .B
  478. \fB\-i\fP, \fB\-\-relay\-device\fP
  479. Relay interface device for relay sockets
  480. (NOT RECOMMENDED. Optional, Linux only).
  481. .TP
  482. .B
  483. \fB\-E\fP, \fB\-\-relay\-ip\fP
  484. Relay address (the local IP address that
  485. will be used to relay the packets to the
  486. peer). Multiple relay addresses may be used:
  487. \fB\-E\fP ip1 \fB\-E\fP ip2 \fB\-E\fP ip3
  488. The same \fBIP\fP(s) can be used as both listening \fBIP\fP(s) and relay \fBIP\fP(s).
  489. If no relay \fBIP\fP(s) specified, then the \fIturnserver\fP will apply the
  490. default policy: it will decide itself which relay addresses to be
  491. used, and it will always be using the client socket IP address as
  492. the relay IP address of the TURN session (if the requested relay
  493. address family is the same as the family of the client socket).
  494. .TP
  495. .B
  496. \fB\-X\fP, \fB\-\-external\-ip\fP
  497. \fBTURN Server\fP public/private address mapping, if the server is behind NAT.
  498. In that situation, if a \fB\-X\fP is used in form "\fB\-X\fP <ip>" then that ip will be reported
  499. as relay IP address of all allocations. This scenario works only in a simple case
  500. when one single relay address is be used, and no CHANGE_REQUEST functionality is
  501. required. That single relay address must be mapped by NAT to the 'external' IP.
  502. The "external\-ip" value, if not empty, is returned in XOR\-RELAYED\-ADDRESS field.
  503. For that 'external' IP, NAT must forward ports directly (relayed port 12345
  504. must be always mapped to the same 'external' port 12345).
  505. In more complex case when more than one IP address is involved,
  506. that option must be used several times, each entry must
  507. have form "\fB\-X\fP <public\-ip/private\-ip>", to map all involved addresses.
  508. CHANGE_REQUEST (RFC5780 or RFC3489) NAT discovery STUN functionality will work
  509. correctly, if the addresses are mapped properly, even when the TURN server itself
  510. is behind A NAT.
  511. By default, this value is empty, and no address mapping is used.
  512. .TP
  513. .B
  514. \fB\-m\fP, \fB\-\-relay\-threads\fP
  515. Number of the relay threads to handle the established connections
  516. (in addition to authentication thread and the listener thread).
  517. If explicitly set to 0 then application runs relay process in a single thread,
  518. in the same thread with the listener process (the authentication thread will
  519. still be a separate thread). If not set, then a default optimal algorithm
  520. will be employed (OS\-dependent). In the older Linux systems
  521. (before Linux kernel 3.9), the number of UDP threads is always one threads
  522. per network listening endpoint \- unless "\fB\-m\fP 0" or "\fB\-m\fP 1" is set.
  523. .TP
  524. .B
  525. \fB\-\-min\-port\fP
  526. Lower bound of the UDP port range for relay
  527. endpoints allocation.
  528. Default value is 49152, according to RFC 5766.
  529. .TP
  530. .B
  531. \fB\-\-max\-port\fP
  532. Upper bound of the UDP port range for relay
  533. endpoints allocation.
  534. Default value is 65535, according to RFC 5766.
  535. .TP
  536. .B
  537. \fB\-u\fP, \fB\-\-user\fP
  538. Long\-term security mechanism credentials user account,
  539. in the column\-separated form username:key.
  540. Multiple user accounts may be used in the command line.
  541. The key is either the user password, or
  542. the key is generated
  543. by \fIturnadmin\fP command. In the second case,
  544. the key must be prepended with 0x symbols.
  545. The key is calculated over the user name,
  546. the user realm, and the user password.
  547. This setting may not be used with TURN REST API.
  548. .TP
  549. .B
  550. \fB\-r\fP, \fB\-\-realm\fP
  551. The default realm to be used for the users when no explicit
  552. origin/realm relationship was found in the database, or if the TURN
  553. server is not using any database (just the commands\-line settings
  554. and the userdb file). Must be used with long\-term credentials
  555. mechanism or with TURN REST API.
  556. .TP
  557. .B
  558. \fB\-C\fP, \fB\-\-rest\-api\-separator\fP
  559. This is the timestamp/username separator symbol
  560. (character) in TURN REST API. The default value is :.
  561. .TP
  562. .B
  563. \fB\-q\fP, \fB\-\-user\-quota\fP
  564. Per\-user allocations quota: how many concurrent
  565. allocations a user can create. This option can also be set
  566. through the database, for a particular realm.
  567. .TP
  568. .B
  569. \fB\-Q\fP, \fB\-\-total\-quota\fP
  570. Total allocations quota: global limit on concurrent allocations.
  571. This option can also be set through the database, for a particular realm.
  572. .TP
  573. .B
  574. \fB\-s\fP, \fB\-\-max\-bps\fP
  575. Max bytes\-per\-second bandwidth a TURN session is allowed to handle
  576. (input and output network streams are treated separately). Anything above
  577. that limit will be dropped or temporary suppressed (within the
  578. available buffer limits). This option can also be set through the
  579. database, for a particular realm.
  580. .TP
  581. .B
  582. \fB\-B\fP, \fB\-\-bps\-capacity\fP
  583. Maximum server capacity.
  584. Total bytes\-per\-second bandwidth the TURN server is allowed to allocate
  585. for the sessions, combined (input and output network streams are treated
  586. separately).
  587. .TP
  588. .B
  589. \fB\-\-static\-auth\-secret\fP
  590. Static authentication secret value (a string) for TURN REST API only.
  591. If not set, then the turn server will try to use the dynamic value
  592. in turn_secret table in user database (if present). The database\-stored
  593. value can be changed on\-the\-fly by a separate program, so this is why
  594. that other mode is dynamic. Multiple shared secrets can be used
  595. (both in the database and in the "static" fashion).
  596. .TP
  597. .B
  598. \fB\-\-server\-name\fP
  599. Server name used for
  600. the oAuth authentication purposes.
  601. The default value is the realm name.
  602. .TP
  603. .B
  604. \fB\-\-cert\fP
  605. Certificate file, PEM format. Same file
  606. search rules applied as for the configuration
  607. file. If both \fB\-\-no\-tls\fP and \fB\-\-no\-dtls\fP \fIoptions\fP
  608. are specified, then this parameter is not needed.
  609. Default value is turn_server_cert.pem.
  610. .TP
  611. .B
  612. \fB\-\-pkey\fP
  613. Private key file, PEM format. Same file
  614. search rules applied as for the configuration
  615. file. If both \fB\-\-no\-tls\fP and \fB\-\-no\-dtls\fP \fIoptions\fP
  616. are specified, then this parameter is not needed.
  617. Default value is turn_server_pkey.pem.
  618. .TP
  619. .B
  620. \fB\-\-pkey\-pwd\fP
  621. If the private key file is encrypted, then this password to be used.
  622. .TP
  623. .B
  624. \fB\-\-cipher\-list\fP
  625. Allowed OpenSSL cipher list for TLS/DTLS connections.
  626. Default value is "DEFAULT".
  627. .TP
  628. .B
  629. \fB\-\-CA\-file\fP
  630. CA file in OpenSSL format.
  631. Forces TURN server to verify the client SSL certificates.
  632. By default, no CA is set and no client certificate check is performed.
  633. .TP
  634. .B
  635. \fB\-\-ec\-curve\-name\fP
  636. Curve name for EC ciphers, if supported by OpenSSL
  637. library (TLS and DTLS). The default value is prime256v1,
  638. if pre\-OpenSSL 1.0.2 is used. With OpenSSL 1.0.2+,
  639. an optimal curve will be automatically calculated, if not defined
  640. by this option.
  641. .TP
  642. .B
  643. \fB\-\-dh\-file\fP
  644. Use custom DH TLS key, stored in PEM format in the file.
  645. Flags \fB\-\-dh566\fP and \fB\-\-dh2066\fP are ignored when the DH key is taken from a file.
  646. .TP
  647. .B
  648. \fB\-l\fP, \fB\-\-log\-file\fP
  649. Option to set the full path name of the log file.
  650. By default, the \fIturnserver\fP tries to open a log file in
  651. /var/log/\fIturnserver\fP, /var/log, /var/tmp, /tmp and . (current)
  652. directories (which file open operation succeeds
  653. first that file will be used). With this option you can set the
  654. definite log file name.
  655. The special names are "stdout" and "\-" \- they will force everything
  656. to the stdout. Also, "syslog" name will redirect everything into
  657. the system log (syslog), as if the option "\fB\-\-syslog\fP" was set.
  658. In the runtime, the logfile can be reset with the SIGHUP signal
  659. to the \fIturnserver\fP process.
  660. .TP
  661. .B
  662. \fB\-\-alternate\-server\fP
  663. Option to set the "redirection" mode. The value of this option
  664. will be the address of the alternate server for UDP & TCP service in form of
  665. <ip>[:<port>]. The server will send this value in the attribute
  666. ALTERNATE\-SERVER, with error 300, on ALLOCATE request, to the client.
  667. Client will receive only values with the same address family
  668. as the client network endpoint address family.
  669. See RFC 5389 and RFC 5766 for ALTERNATE\-SERVER functionality description.
  670. The client must use the obtained value for subsequent TURN communications.
  671. If more than one \fB\-\-alternate\-server\fP \fIoptions\fP are provided, then the functionality
  672. can be more accurately described as "load\-balancing" than a mere "redirection".
  673. If the port number is omitted, then the default port
  674. number 3478 for the UDP/TCP protocols will be used.
  675. Colon (:) characters in IPv6 addresses may conflict with the syntax of
  676. the option. To alleviate this conflict, literal IPv6 addresses are enclosed
  677. in square brackets in such resource identifiers, for example:
  678. [2001:db8:85a3:8d3:1319:8a2e:370:7348]:3478 .
  679. Multiple alternate servers can be set. They will be used in the
  680. round\-robin manner. All servers in the pool are considered of equal weight and
  681. the load will be distributed equally. For example, if we have 4 alternate servers,
  682. then each server will receive 25% of ALLOCATE requests. An alternate TURN server
  683. address can be used more than one time with the alternate\-server option, so this
  684. can emulate "weighting" of the servers.
  685. .TP
  686. .B
  687. \fB\-\-tls\-alternate\-server\fP
  688. Option to set alternative server for TLS & DTLS services in form of
  689. <ip>:<port>. If the port number is omitted, then the default port
  690. number 5349 for the TLS/DTLS protocols will be used. See the
  691. previous option for the functionality description.
  692. .TP
  693. .B
  694. \fB\-O\fP, \fB\-\-redis\-statsdb\fP
  695. Redis status and statistics database connection string, if used (default \- empty,
  696. no Redis stats DB used). This database keeps allocations status information, and it can
  697. be also used for publishing and delivering traffic and allocation event notifications.
  698. This database option can be used independently of \fB\-\-redis\-userdb\fP option,
  699. and actually Redis can be used for status/statistics and SQLite or MySQL or MongoDB or
  700. PostgreSQL can be used for the user database.
  701. The connection string has the same parameters as redis\-userdb connection string.
  702. .TP
  703. .B
  704. \fB\-\-max\-allocate\-timeout\fP
  705. Max time, in seconds, allowed for full allocation establishment.
  706. Default is 60 seconds.
  707. .PP
  708. \fB\-\-denied\-peer\-ip\fP=<IPaddr[\fB\-IPaddr\fP]>
  709. .PP
  710. \fB\-\-allowed\-peer\-ip\fP=<IPaddr[\fB\-IPaddr\fP]> Options to ban or allow specific ip addresses or ranges
  711. of ip addresses. If an ip address is specified as both allowed and denied, then
  712. the ip address is considered to be allowed. This is useful when you wish to ban
  713. a range of ip addresses, except for a few specific ips within that range.
  714. This can be used when you do not want users of the turn server to be able to access
  715. machines reachable by the turn server, but would otherwise be unreachable from the
  716. internet (e.g. when the turn server is sitting behind a NAT). The 'white" and "black" peer
  717. IP ranges can also be dynamically changed in the database.
  718. The allowed/denied addresses (white/black lists) rules are very simple:
  719. .RS
  720. .IP 1) 4
  721. If there is no rule for an address, then it is allowed;
  722. .IP 2) 4
  723. If there is an "allowed" rule that fits the address then it is allowed \- no matter what;
  724. .IP 3) 4
  725. If there is no "allowed" rule that fits the address, and if there is a "denied" rule that
  726. fits the address, then it is denied.
  727. .RE
  728. .TP
  729. .B
  730. \fB\-\-pidfile\fP
  731. File name to store the pid of the process.
  732. Default is /var/run/turnserver.pid (if superuser account is used) or
  733. /var/tmp/turnserver.pid .
  734. .TP
  735. .B
  736. \fB\-\-proc\-user\fP
  737. User name to run the process. After the initialization, the \fIturnserver\fP process
  738. will make an attempt to change the current user ID to that user.
  739. .TP
  740. .B
  741. \fB\-\-proc\-group\fP
  742. Group name to run the process. After the initialization, the \fIturnserver\fP process
  743. will make an attempt to change the current group ID to that group.
  744. .TP
  745. .B
  746. \fB\-\-cli\-ip\fP
  747. Local system IP address to be used for CLI management interface.
  748. The \fIturnserver\fP process can be accessed for management with telnet,
  749. at this IP address and on the CLI port (see the next parameter).
  750. Default value is 127.0.0.1. You can use telnet or putty (in telnet mode)
  751. to access the CLI management interface.
  752. .TP
  753. .B
  754. \fB\-\-cli\-port\fP
  755. CLI management interface listening port. Default is 5766.
  756. .TP
  757. .B
  758. \fB\-\-cli\-password\fP
  759. CLI access password. Default is empty (no password).
  760. For the security reasons, it is recommended to use the encrypted
  761. form of the password (see the \fB\-P\fP command in the \fIturnadmin\fP
  762. utility). The dollar signs in the encrypted form must be escaped.
  763. .TP
  764. .B
  765. \fB\-\-cli\-max\-output\-sessions\fP
  766. Maximum number of output sessions in ps CLI command.
  767. This value can be changed on\-the\-fly in CLI. The default value is 256.
  768. .TP
  769. .B
  770. \fB\-\-ne\fP=[1|2|3]
  771. Set network engine type for the process (for internal purposes).
  772. .PP
  773. ==================================
  774. .SH LOAD BALANCE AND PERFORMANCE TUNING
  775. This topic is covered in the wiki page:
  776. .PP
  777. https://github.com/coturn/coturn/wiki/turn_performance_and_load_balance
  778. .PP
  779. ===================================
  780. .SH WEBRTC USAGE
  781. This is a set of notes for the WebRTC users:
  782. .IP 1) 4
  783. WebRTC uses long\-term authentication mechanism, so you have to use \fB\-a\fP
  784. option (or \fB\-\-lt\-cred\-mech\fP). WebRTC relaying will not work with anonymous
  785. access. With \fB\-a\fP option, do not forget to set the
  786. default realm (\fB\-r\fP option). You will also have to set up the user accounts,
  787. for that you have a number of \fIoptions\fP:
  788. .PP
  789. .nf
  790. .fam C
  791. a) command\-line options (\-u).
  792. b) a database table (SQLite or PostgreSQL or MySQL or MongoDB). You will have to
  793. set keys with turnadmin utility (see docs and wiki for turnadmin).
  794. You cannot use open passwords in the database.
  795. c) Redis key/value pair(s), if Redis is used. You key use either keys or
  796. open passwords with Redis; see turndb/testredisdbsetup.sh file.
  797. d) You also can use the TURN REST API. You will need shared secret(s) set
  798. either through the command line option, or through the config file, or through
  799. the database table or Redis key/value pairs.
  800. .fam T
  801. .fi
  802. .IP 2) 4
  803. Usually WebRTC uses fingerprinting (\fB\-f\fP).
  804. .IP 3) 4
  805. \fB\-v\fP option may be nice to see the connected clients.
  806. .IP 4) 4
  807. \fB\-X\fP is needed if you are running your TURN server behind a NAT.
  808. .IP 5) 4
  809. \fB\-\-min\-port\fP and \fB\-\-max\-port\fP may be needed if you want to limit the relay endpoints ports
  810. number range.
  811. .PP
  812. ===================================
  813. .SH TURN REST API
  814. In WebRTC, the browser obtains the TURN connection information from the web
  815. server. This information is a secure information \- because it contains the
  816. necessary TURN credentials. As these credentials are transmitted over the
  817. public networks, we have a potential security breach.
  818. .PP
  819. If we have to transmit a valuable information over the public network,
  820. then this information has to have a limited lifetime. Then the guy who
  821. obtains this information without permission will be able to perform
  822. only limited damage.
  823. .PP
  824. This is how the idea of TURN REST API \- time\-limited TURN credentials \-
  825. appeared. This security mechanism is based upon the long\-term credentials
  826. mechanism. The main idea of the REST API is that the web server provides
  827. the credentials to the client, but those credentials can be used only
  828. limited time by an application that has to create a TURN server connection.
  829. .PP
  830. The "classic" long\-term credentials mechanism (LTCM) is described here:
  831. .PP
  832. http://tools.ietf.org/html/rfc5389#section\-10.2
  833. .PP
  834. http://tools.ietf.org/html/rfc5389#section\-15.4
  835. .PP
  836. For authentication, each user must know two things: the username and the
  837. password. Optionally, the user must supply the ORIGIN value, so that the
  838. server can figure out the realm to be used for the user. The nonce and
  839. the realm values are supplied by the TURN server. But LTCM is not saying
  840. anything about the nature and about the persistence of the username and
  841. of the password; and this is used by the REST API.
  842. .PP
  843. In the TURN REST API, there is no persistent passwords for users. A user has
  844. just the username. The password is always temporary, and it is generated by
  845. the web server on\-demand, when the user accesses the WebRTC page. And,
  846. actually, a temporary one\-time session only, username is provided to the user,
  847. too.
  848. .PP
  849. The temporary user is generated as:
  850. .PP
  851. temporary\-username="timestamp" + ":" + "username"
  852. .PP
  853. where username is the persistent user name, and the timestamp format is just
  854. seconds sinse 1970 \- the same value as \fBtime\fP(NULL) function returns.
  855. .PP
  856. The temporary password is obtained as HMAC\-SHA1 function over the temporary
  857. username, with shared secret as the HMAC key, and then the result is encoded:
  858. .PP
  859. temporary\-password = \fBbase64_encode\fP(hmac\-sha1(shared\-secret, temporary\-username))
  860. .PP
  861. Both the TURN server and the web server know the same shared secret. How the
  862. shared secret is distributed among the involved entities is left to the WebRTC
  863. deployment details \- this is beyond the scope of the TURN REST API.
  864. .PP
  865. So, a timestamp is used for the temporary password calculation, and this
  866. timestamp can be retrieved from the temporary username. This information
  867. is valuable, but only temporary, while the timestamp is not expired. Without
  868. knowledge of the shared secret, a new temporary password cannot be generated.
  869. .PP
  870. This is all formally described in Justin's Uberti TURN REST API document
  871. that can be obtained following the link "TURN REST API" in the \fBTURN Server\fP
  872. project's page https://github.com/coturn/coturn/.
  873. .PP
  874. Once the temporary username and password are obtained by the client (browser)
  875. application, then the rest is just 'classic" long\-term credentials mechanism.
  876. For developers, we are going to describe it step\-by\-step below:
  877. .RS
  878. .IP \(bu 3
  879. a new TURN client sends a request command to the TURN server. Optionally,
  880. it adds the ORIGIN field to it.
  881. .IP \(bu 3
  882. TURN server sees that this is a new client and the message is not
  883. authenticated.
  884. .IP \(bu 3
  885. the TURN server generates a random nonce string, and return the
  886. error 401 to the client, with nonce and realm included. If the ORIGIN
  887. field was present in the client request, it may affect the realm value
  888. that the server chooses for the client.
  889. .IP \(bu 3
  890. the client sees the 401 error and it extracts two values from
  891. the error response: the nonce and the realm.
  892. .IP \(bu 3
  893. the client uses username, realm and password to produce a key:
  894. .PP
  895. .nf
  896. .fam C
  897. key = MD5(username ":" realm ":" SASLprep(password))
  898. .fam T
  899. .fi
  900. (SASLprep is described here: http://tools.ietf.org/html/rfc4013)
  901. .IP \(bu 3
  902. the client forms a new request, adds username, realm and nonce to the
  903. request. Then, the client calculates and adds the integrity field to
  904. the request. This is the trickiest part of the process, and it is
  905. described in the end of section 15.4:
  906. http://tools.ietf.org/html/rfc5389#section\-15.4
  907. .IP \(bu 3
  908. the client, optionally, adds the fingerprint field. This may be also
  909. a tricky procedure, described in section 15.5 of the same document.
  910. WebRTC usually uses fingerprinted TURN messages.
  911. .IP \(bu 3
  912. the TURN server receives the request, reads the username.
  913. .IP \(bu 3
  914. then the TURN server checks that the nonce and the realm in the request
  915. are the valid ones.
  916. .IP \(bu 3
  917. then the TURN server calculates the key.
  918. .IP \(bu 3
  919. then the TURN server calculates the integrity field.
  920. .IP \(bu 3
  921. then the TURN server compares the calculated integrity field with the
  922. received one \- they must be the same. If the integrity fields differ,
  923. then the request is rejected.
  924. .RE
  925. .PP
  926. In subsequent communications, the client may go with exactly the same
  927. sequence, but for optimization usually the client, having already
  928. information about realm and nonce, pre\-calculates the integrity string
  929. for each request, so that the 401 error response becomes unnecessary.
  930. The TURN server may use "\fB\-\-stale\-nonce\fP" option for extra security: in
  931. some time, the nonce expires and the client will obtain 438 error response
  932. with the new nonce, and the client will have to start using the new nonce.
  933. .PP
  934. In subsequent communications, the sever and the client will always assume
  935. the same password \- the original password becomes the session parameter and
  936. is never expiring. So the password is not changing while the session is valid
  937. and unexpired. So, if the session is properly maintained, it may go forever,
  938. even if the user password has been already changed (in the database). The
  939. session simply is using the old password. Once the session got disconnected,
  940. the client will have to use the new password to re\-connect (if the password
  941. has been changed).
  942. .PP
  943. An example when a new shared secret is generated every hour by the TURN server
  944. box and then supplied to the web server, remotely, is provided in the script
  945. examples/scripts/restapi/shared_secret_maintainer.pl .
  946. .PP
  947. A very important thing is that the nonce must be totally random and it must be
  948. different for different clients and different sessions.
  949. .PP
  950. ===================================
  951. .SH DATABASES
  952. For the user database, the \fIturnserver\fP has the following \fIoptions\fP:
  953. .IP 1) 4
  954. Users can be set in the command line, with multiple \fB\-u\fP or \fB\-\-user\fP \fIoptions\fP.
  955. Obviously, only a few users can be set that way, and their credentials are fixed
  956. for the \fIturnserver\fP process lifetime.
  957. .IP 2) 4
  958. Users can be stored in SQLite DB. The default SQLite database file is /var/db/turndb
  959. or /usr/local/var/db/turndb or /var/lib/turn/turndb.
  960. .IP 3) 4
  961. Users can be stored in PostgreSQL database, if the \fIturnserver\fP was compiled with PostgreSQL
  962. support. Each time \fIturnserver\fP checks user credentials, it reads the database (asynchronously,
  963. of course, so that the current flow of packets is not delayed in any way), so any change in the
  964. database content is immediately visible by the \fIturnserver\fP. This is the way if you need the
  965. best scalability. The schema for the database can be found in schema.sql file.
  966. For long\-term credentials, you have to set the "keys" for the users; the "keys" are generated
  967. by the \fIturnadmin\fP utility. For the key generation, you need username, password and the realm.
  968. All users in the database must use the same realm value; if down the road you will decide
  969. to change the realm name, then you will have to re\-generate all user keys (that can be done
  970. in a batch script). See the file turndb/testsqldbsetup.sql as an example.
  971. .IP 4) 4
  972. The same is true for MySQL database. The same schema file is applicable.
  973. The same considerations are applicable.
  974. .IP 5) 4
  975. The same is true for the Redis database, but the Redis database has aa different schema \-
  976. it can be found (in the form of explanation) in schema.userdb.redis.
  977. Also, in Redis you can store both "keys" and open passwords (for long term credentials) \-
  978. the "open password" option is less secure but more convenient for low\-security environments.
  979. See the file turndb/testredisdbsetup.sh as an example.
  980. .IP 6) 4
  981. If a database is used, then users can be divided into multiple independent realms. Each realm
  982. can be administered separately, and each realm can have its own set of users and its own
  983. performance \fIoptions\fP (max\-bps, user\-quota, total\-quota).
  984. .IP 7) 4
  985. If you use MongoDB, the database will be setup for you automatically.
  986. .IP 8) 4
  987. Of course, the \fIturnserver\fP can be used in non\-secure mode, when users are allowed to establish
  988. sessions anonymously. But in most cases (like WebRTC) that will not work.
  989. .PP
  990. For the status and statistics database, there are two choices:
  991. .IP 1) 4
  992. The simplest choice is not to use it. Do not set \fB\-\-redis\-statsdb\fP option, and this functionality
  993. will be simply ignored.
  994. .IP 2) 4
  995. If you choose to use it, then set the \fB\-\-redis\-statsdb\fP option. This may be the same database
  996. as in \fB\-\-redis\-userdb\fP option, or it may be a different database. You may want to use different
  997. database for security or convenience reasons. Also, you can use different database management
  998. systems for the user database and for the ststus and statistics database. For example, you can use
  999. MySQL as the user database, and you can use redis for the statistics. Or you can use Redis for both.
  1000. .PP
  1001. So, we have 6 choices for the user management, and 2 choices for the statistics management. These
  1002. two are totally independent. So, you have overall 6*2=12 ways to handle persistent information,
  1003. choose any for your convenience.
  1004. .PP
  1005. You do not have to handle the database information "manually" \- the \fIturnadmin\fP program can handle
  1006. everything for you. For PostgreSQL and MySQL you will just have to create an empty database
  1007. with schema.sql SQL script. With Redis, you do not have to do even that \- just run \fIturnadmin\fP and
  1008. it will set the users for you (see the \fIturnadmin\fP manuals). If you are using SQLite, then the
  1009. \fIturnserver\fP or \fIturnadmin\fP will initialize the empty database, for you, when started. The
  1010. TURN server installation process creates an empty initialized SQLite database in the default
  1011. location (/var/db/turndb or /usr/local/var/db/turndb or /var/lib/turn/turndb, depending on the system).
  1012. .PP
  1013. =================================
  1014. .SH ALPN
  1015. The server supports ALPNs "stun.turn" and "stun.nat\-discovery", when
  1016. compiled with OpenSSL 1.0.2 or newer. If the server receives a TLS/DTLS
  1017. ClientHello message that contains one or both of those ALPNs, then the
  1018. server chooses the first stun.* label and sends it back (in the ServerHello)
  1019. in the ALPN extension field. If no stun.* label is found, then the server
  1020. does not include the ALPN information into the ServerHello.
  1021. .PP
  1022. =================================
  1023. .SH LIBRARIES
  1024. In the lib/ sub\-directory the build process will create TURN client messaging library.
  1025. In the include/ sub\-directory, the necessary include files will be placed.
  1026. The C++ wrapper for the messaging functionality is located in TurnMsgLib.h header.
  1027. An example of C++ code can be found in stunclient.c file.
  1028. .PP
  1029. =================================
  1030. .SH DOCS
  1031. After installation, run the command:
  1032. .PP
  1033. $ man \fIturnserver\fP
  1034. .PP
  1035. or in the project root directory:
  1036. .PP
  1037. $ man \fB\-M\fP man \fIturnserver\fP
  1038. .PP
  1039. to see the man page.
  1040. .PP
  1041. In the docs/html subdirectory of the original archive tree, you will find the client library
  1042. reference. After the installation, it will be placed in PREFIX/share/doc/\fIturnserver\fP/html.
  1043. .PP
  1044. =================================
  1045. .SH LOGS
  1046. When the \fBTURN Server\fP starts, it makes efforts to create a log file turn_<pid>.log
  1047. in the following directories:
  1048. .RS
  1049. .IP \(bu 3
  1050. /var/log
  1051. .IP \(bu 3
  1052. /log/
  1053. .IP \(bu 3
  1054. /var/tmp
  1055. .IP \(bu 3
  1056. /tmp
  1057. .IP \(bu 3
  1058. current directory
  1059. .RE
  1060. .PP
  1061. If all efforts failed (due to the system permission settings) then all
  1062. log messages are sent only to the standard output of the process.
  1063. .PP
  1064. This behavior can be controlled by \fB\-\-log\-file\fP, \fB\-\-syslog\fP and \fB\-\-no\-stdout\-log\fP
  1065. \fIoptions\fP.
  1066. .PP
  1067. =================================
  1068. .SH HTTPS MANAGEMENT INTERFACE
  1069. The \fIturnserver\fP process provides an HTTPS Web access as statistics and basic
  1070. management interface. The \fIturnserver\fP listens to incoming HTTPS admin
  1071. connections on the same ports as the main TURN/STUN listener. The Web admin
  1072. pages are basic and self\-explanatory.
  1073. .PP
  1074. To make the HTTPS interface active, the database table admin_user must be
  1075. populated with the admin user \fBaccount\fP(s). An admin user can be a superuser
  1076. (if not assigned to a particular realm) or a restricted user (if assigned to
  1077. a realm). The restricted admin users can perform only limited actions, within
  1078. their corresponding realms.
  1079. .PP
  1080. =================================
  1081. .SH TELNET CLI
  1082. The \fIturnserver\fP process provides a telnet CLI access as statistics and basic management
  1083. interface. By default, the \fIturnserver\fP starts a telnet CLI listener on IP 127.0.0.1 and
  1084. port 5766. That can be changed by the command\-cline \fIoptions\fP of the \fIturnserver\fP process
  1085. (see \fB\-\-cli\-ip\fP and \fB\-\-cli\-port\fP \fIoptions\fP). The full list of telnet CLI commands is provided
  1086. in "help" command output in the telnet CLI.
  1087. .PP
  1088. =================================
  1089. .SH CLUSTERS
  1090. \fBTURN Server\fP can be a part of the cluster installation. But, to support the "even port" functionality
  1091. (RTP/RTCP streams pairs) the client requests from a particular IP must be delivered to the same
  1092. \fBTURN Server\fP instance, so it requires some networking setup massaging for the cluster. The reason is that
  1093. the RTP and RTCP relaying endpoints must be allocated on the same relay IP. It would be possible
  1094. to design a scheme with the application\-level requests forwarding (and we may do that later) but
  1095. it would affect the performance.
  1096. .PP
  1097. =================================
  1098. .SH FILES
  1099. /etc/turnserver.conf
  1100. .PP
  1101. /var/db/turndb
  1102. .PP
  1103. /usr/local/var/db/turndb
  1104. .PP
  1105. /var/lib/turn/turndb
  1106. .PP
  1107. /usr/local/etc/turnserver.conf
  1108. .PP
  1109. =================================
  1110. .SH DIRECTORIES
  1111. /usr/local/share/\fIturnserver\fP
  1112. .PP
  1113. /usr/local/share/doc/\fIturnserver\fP
  1114. .PP
  1115. /usr/local/share/examples/\fIturnserver\fP
  1116. .PP
  1117. =================================
  1118. .SH STANDARDS
  1119. obsolete STUN RFC 3489
  1120. .PP
  1121. new STUN RFC 5389
  1122. .PP
  1123. TURN RFC 5766
  1124. .PP
  1125. TURN\-TCP extension RFC 6062
  1126. .PP
  1127. TURN IPv6 extension RFC 6156
  1128. .PP
  1129. STUN/TURN test vectors RFC 5769
  1130. .PP
  1131. STUN NAT behavior discovery RFC 5780
  1132. .PP
  1133. =================================
  1134. .SH SEE ALSO
  1135. \fIturnadmin\fP, \fIturnutils\fP
  1136. .RE
  1137. .PP
  1138. ======================================
  1139. .SS WEB RESOURCES
  1140. project page:
  1141. .PP
  1142. https://github.com/coturn/coturn/
  1143. .PP
  1144. Wiki page:
  1145. .PP
  1146. https://github.com/coturn/coturn/wiki
  1147. .PP
  1148. forum:
  1149. .PP
  1150. https://groups.google.com/forum/?fromgroups=#!forum/turn\-server\-project\-rfc5766\-turn\-server
  1151. .PP
  1152. ======================================
  1153. .SS AUTHORS
  1154. Oleg Moskalenko <[email protected]>
  1155. .PP
  1156. Gabor Kovesdan http://kovesdan.org/
  1157. .PP
  1158. Daniel Pocock http://danielpocock.com/
  1159. .PP
  1160. John Selbie ([email protected])
  1161. .PP
  1162. Lee Sylvester <[email protected]>
  1163. .PP
  1164. Erik Johnston <[email protected]>
  1165. .PP
  1166. Roman Lisagor <[email protected]>
  1167. .PP
  1168. Vladimir Tsanev <[email protected]>
  1169. .PP
  1170. Po\-sheng Lin <[email protected]>
  1171. .PP
  1172. Peter Dunkley <[email protected]>
  1173. .PP
  1174. Mutsutoshi Yoshimoto <[email protected]>
  1175. .PP
  1176. Federico Pinna <[email protected]>
  1177. .PP
  1178. Bradley T. Hughes <[email protected]>
  1179. .PP
  1180. Mihaly Meszaros <[email protected]>