Advertisement
ToanTK

JanusJCFG-STUN/TURN-enable

Jun 16th, 2020
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.58 KB | None | 0 0
  1. # General configuration: folders where the configuration and the plugins
  2. # can be found, how output should be logged, whether Janus should run as
  3. # a daemon or in foreground, default interface to use, debug/logging level
  4. # and, if needed, shared apisecret and/or token authentication mechanism
  5. # between application(s) and Janus.
  6. general: {
  7. configs_folder = "/opt/janus/etc/janus" # Configuration files folder
  8. plugins_folder = "/opt/janus/lib/janus/plugins" # Plugins folder
  9. transports_folder = "/opt/janus/lib/janus/transports" # Transports folder
  10. events_folder = "/opt/janus/lib/janus/events" # Event handlers folder
  11. loggers_folder = "/opt/janus/lib/janus/loggers" # External loggers folder
  12.  
  13. # The next settings configure logging
  14. #log_to_stdout = false # Whether the Janus output should be written
  15. # to stdout or not (default=true)
  16. #log_to_file = "/path/to/janus.log" # Whether to use a log file or not
  17. debug_level = 7 # Debug/logging level, valid values are 0-7
  18. #debug_timestamps = true # Whether to show a timestamp for each log line
  19. #debug_colors = false # Whether colors should be disabled in the log
  20. #debug_locks = true # Whether to enable debugging of locks (very verbose!)
  21. log_prefix = "[janus] " # In case you want log lines to be prefixed by some
  22. # custom text, you can use the 'log_prefix' property.
  23. # It supports terminal colors, meaning something like
  24. # "[\x1b[32mjanus\x1b[0m] " would show a green "janus"
  25. # string in square brackets (assuming debug_colors=true).
  26.  
  27. # This is what you configure if you want to launch Janus as a daemon
  28. #daemonize = true # Whether Janus should run as a daemon
  29. # or not (default=run in foreground)
  30. #pid_file = "/path/to/janus.pid" # PID file to create when Janus has been
  31. # started, and to destroy at shutdown
  32.  
  33. # There are different ways you can authenticate the Janus and Admin APIs
  34. #api_secret = "janusrocks" # String that all Janus requests must contain
  35. # to be accepted/authorized by the Janus core.
  36. # Useful if you're wrapping all Janus API requests
  37. # in your servers (that is, not in the browser,
  38. # where you do the things your way) and you
  39. # don't want other application to mess with
  40. # this Janus instance.
  41. #token_auth = true # Enable a token based authentication
  42. # mechanism to force users to always provide
  43. # a valid token in all requests. Useful if
  44. # you want to authenticate requests from web
  45. # users.
  46. #token_auth_secret = "janus" # Use HMAC-SHA1 signed tokens (with token_auth). Note that
  47. # without this, the Admin API MUST
  48. # be enabled, as tokens are added and removed
  49. # through messages sent there.
  50. admin_secret = "janusoverlord" # String that all Janus requests must contain
  51. # to be accepted/authorized by the admin/monitor.
  52. # only needed if you enabled the admin API
  53. # in any of the available transports.
  54.  
  55. # Generic settings
  56. #interface = "1.2.3.4" # Interface to use (will be used in SDP)
  57. #server_name = "MyJanusInstance"# Public name of this Janus instance
  58. # as it will appear in an info request
  59. #session_timeout = 60 # How long (in seconds) we should wait before
  60. # deciding a Janus session has timed out. A
  61. # session times out when no request is received
  62. # for session_timeout seconds (default=60s).
  63. # Setting this to 0 will disable the timeout
  64. # mechanism, which is NOT suggested as it may
  65. # risk having orphaned sessions (sessions not
  66. # controlled by any transport and never freed).
  67. # To avoid timeouts, keep-alives can be used.
  68. #candidates_timeout = 45 # How long (in seconds) we should keep hold of
  69. # pending (trickle) candidates before discarding
  70. # them (default=45s). Notice that setting this
  71. # to 0 will NOT disable the timeout, but will
  72. # be considered an invalid value and ignored.
  73. #reclaim_session_timeout = 0 # How long (in seconds) we should wait for a
  74. # janus session to be reclaimed after the transport
  75. # is gone. After the transport is gone, a session
  76. # times out when no request is received for
  77. # reclaim_session_timeout seconds (default=0s).
  78. # Setting this to 0 will disable the timeout
  79. # mechanism, and sessions will be destroyed immediately
  80. # if the transport is gone.
  81. #recordings_tmp_ext = "tmp" # The extension for recordings, in Janus, is
  82. # .mjr, a custom format we devised ourselves.
  83. # By default, we save to .mjr directly. If you'd
  84. # rather the recording filename have a temporary
  85. # extension while it's being saved, and only
  86. # have the .mjr extension when the recording
  87. # is over (e.g., to automatically trigger some
  88. # external scripts), then uncomment and set the
  89. # recordings_tmp_ext property to the extension
  90. # to add to the base (e.g., tmp --> .mjr.tmp).
  91. #event_loops = 8 # By default, Janus handles each have their own
  92. # event loop and related thread for all the media
  93. # routing and management. If for some reason you'd
  94. # rather limit the number of loop/threads, and
  95. # you want handles to share those, you can do that
  96. # configuring the event_loops property: this will
  97. # spawn the specified amount of threads at startup,
  98. # run a separate event loop on each of them, and
  99. # add new handles to one of them when attaching.
  100. # Notice that, while cutting the number of threads
  101. # and possibly reducing context switching, this
  102. # might have an impact on the media delivery,
  103. # especially if the available loops can't take
  104. # care of all the handles and their media in time.
  105. # As such, if you want to use this you should
  106. # provision the correct value according to the
  107. # available resources (e.g., CPUs available).
  108. #opaqueid_in_api = true # Opaque IDs set by applications are typically
  109. # only passed to event handlers for correlation
  110. # purposes, but not sent back to the user or
  111. # application in the related Janus API responses
  112. # or events; in case you need them to be in the
  113. # Janus API too, set this property to 'true'.
  114. #hide_dependencies = true # By default, a call to the "info" endpoint of
  115. # either the Janus or Admin API now also returns
  116. # the versions of the main dependencies (e.g.,
  117. # libnice, libsrtp, which crypto library is in
  118. # use and so on). Should you want that info not
  119. # to be disclose, set 'hide_dependencies' to true.
  120.  
  121. # The following is ONLY useful when debugging RTP/RTCP packets,
  122. # e.g., to look at unencrypted live traffic with a browser. By
  123. # default it is obviously disabled, as WebRTC mandates encryption.
  124. #no_webrtc_encryption = true
  125.  
  126. # Janus provides ways via its API to specify custom paths to save
  127. # files to (e.g., recordings, pcap captures and the like). In order
  128. # to avoid people can mess with folders they're not supposed to,
  129. # you can configure an array of folders that Janus should prevent
  130. # creating files in. If the 'protected_folder' property below is
  131. # commented, no folder is protected.
  132. # Notice that at the moment this only covers attempts to start
  133. # an .mjr recording and pcap/text2pcap packet captures.
  134. protected_folders = [
  135. "/bin",
  136. "/boot",
  137. "/dev",
  138. "/etc",
  139. "/initrd",
  140. "/lib",
  141. "/lib32",
  142. "/lib64",
  143. "/proc",
  144. "/sbin",
  145. "/sys",
  146. "/usr",
  147. "/var",
  148. # We add what are usually the folders Janus is installed to
  149. # as well: we don't just put "/opt/janus" because that would
  150. # include folders like "/opt/janus/share" that is where
  151. # recordings might be saved to by some plugins
  152. "/opt/janus/bin",
  153. "/opt/janus/etc",
  154. "/opt/janus/include",
  155. "/opt/janus/lib",
  156. "/opt/janus/lib32",
  157. "/opt/janus/lib64",
  158. "/opt/janus/sbin"
  159. ]
  160. }
  161.  
  162. # Certificate and key to use for DTLS (and passphrase if needed). If missing,
  163. # Janus will autogenerate a self-signed certificate to use. Notice that
  164. # self-signed certificates are fine for the purpose of WebRTC DTLS
  165. # connectivity, for the time being, at least until Identity Providers
  166. # are standardized and implemented in browsers. If for some reason you
  167. # want to enforce the DTLS stack in Janus to enforce valid certificates
  168. # from peers, though, you can do that setting 'dtls_accept_selfsigned' to
  169. # 'false' below: DO NOT TOUCH THAT IF YOU DO NOT KNOW WHAT YOU'RE DOING!
  170. # You can also configure the DTLS ciphers to offer: the default if not
  171. # set is "DEFAULT:!NULL:!aNULL:!SHA256:!SHA384:!aECDH:!AESGCM+AES256:!aPSK"
  172. # Finally, by default NIST P-256 certificates are generated (see #1997),
  173. # but RSA generation is still supported if you set 'rsa_private_key' to 'true'.
  174. certificates: {
  175. #cert_pem = "/path/to/certificate.pem"
  176. #cert_key = "/path/to/key.pem"
  177. #cert_pwd = "secretpassphrase"
  178. #dtls_accept_selfsigned = false
  179. #dtls_ciphers = "your-desired-openssl-ciphers"
  180. #rsa_private_key = false
  181. }
  182.  
  183. # Media-related stuff: you can configure whether if you want
  184. # to enable IPv6 support, the minimum size of the NACK queue (in ms,
  185. # defaults to 200ms) for retransmissions no matter the RTT, the range of
  186. # ports to use for RTP and RTCP (by default, no range is envisaged), the
  187. # starting MTU for DTLS (1200 by default, it adapts automatically),
  188. # how much time, in seconds, should pass with no media (audio or
  189. # video) being received before Janus notifies you about this (default=1s,
  190. # 0 disables these events entirely), how many lost packets should trigger
  191. # a 'slowlink' event to users (default=4), and how often, in milliseconds,
  192. # to send the Transport Wide Congestion Control feedback information back
  193. # to senders, if negotiated (default=200ms). Finally, if you're using BoringSSL
  194. # you can customize the frequency of retransmissions: OpenSSL has a fixed
  195. # value of 1 second (the default), while BoringSSL can override that. Notice
  196. # that lower values (e.g., 100ms) will typically get you faster connection
  197. # times, but may not work in case the RTT of the user is high: as such,
  198. # you should pick a reasonable trade-off (usually 2*max expected RTT).
  199. media: {
  200. ipv6 = true
  201. #min_nack_queue = 500
  202. #rtp_port_range = "20000-40000"
  203. #dtls_mtu = 1200
  204. #no_media_timer = 1
  205. #slowlink_threshold = 4
  206. #twcc_period = 100
  207. #dtls_timeout = 500
  208.  
  209. # If you need DSCP packet marking and prioritization, you can configure
  210. # the 'dscp' property to a specific values, and Janus will try to
  211. # set it on all outgoing packets using libnice. Normally, the specs
  212. # suggest to use different values depending on whether audio, video
  213. # or data are used, but since all PeerConnections in Janus are bundled,
  214. # we can only use one. You can refer to this document for more info:
  215. # https://tools.ietf.org/html/draft-ietf-tsvwg-rtcweb-qos-18#page-6
  216. # That said, DON'T TOUCH THIS IF YOU DON'T KNOW WHAT IT MEANS!
  217. #dscp = 46
  218. }
  219.  
  220. # NAT-related stuff: specifically, you can configure the STUN/TURN
  221. # servers to use to gather candidates if the gateway is behind a NAT,
  222. # and srflx/relay candidates are needed. In case STUN is not enough and
  223. # this is needed (it shouldn't), you can also configure Janus to use a
  224. # TURN server# please notice that this does NOT refer to TURN usage in
  225. # browsers, but in the gathering of relay candidates by Janus itself,
  226. # e.g., if you want to limit the ports used by a Janus instance on a
  227. # private machine. Furthermore, you can choose whether Janus should be
  228. # configured to do full-trickle (Janus also trickles its candidates to
  229. # users) rather than the default half-trickle (Janus supports trickle
  230. # candidates from users, but sends its own within the SDP), and whether
  231. # it should work in ICE-Lite mode (by default it doesn't). Finally,
  232. # you can also enable ICE-TCP support (beware that this may lead to problems
  233. # if you do not enable ICE Lite as well), choose which interfaces should
  234. # be used for gathering candidates, and enable or disable the
  235. # internal libnice debugging, if needed.
  236. nat: {
  237. stun_server = "stun.l.google.com"
  238. stun_port=19302
  239. #stun_server = "stun.voip.eutelia.it"
  240. #stun_port = 3478
  241. nice_debug = true
  242. full_trickle = true
  243. ice_lite = true
  244. ice_tcp = true
  245.  
  246. # By default Janus tries to resolve mDNS (.local) candidates: even
  247. # though this is now done asynchronously and shouldn't keep the API
  248. # busy, even in case mDNS resolution takes a long time to timeout,
  249. # you can choose to drop all .local candidates instead, which is
  250. # helpful in case you know clients will never be in the same private
  251. # network as the one the Janus instance is running from. Notice that
  252. # this will cause ICE to fail if mDNS is the only way to connect!
  253. #ignore_mdns = true
  254.  
  255. # In case you're deploying Janus on a server which is configured with
  256. # a 1:1 NAT (e.g., Amazon EC2), you might want to also specify the public
  257. # address of the machine using the setting below. This will result in
  258. # all host candidates (which normally have a private IP address) to
  259. # be rewritten with the public address provided in the settings. As
  260. # such, use the option with caution and only if you know what you're doing.
  261. # Make sure you keep ICE Lite disabled, though, as it's not strictly
  262. # speaking a publicly reachable server, and a NAT is still involved.
  263. # If you'd rather keep the private IP address in place, rather than
  264. # replacing it (and so have both of them as advertised candidates),
  265. # then set the 'keep_private_host' property to true.
  266. # nat_1_1_mapping = "34.87.70.168"
  267. # keep_private_host = true
  268.  
  269. # You can configure a TURN server in two different ways: specifying a
  270. # statically configured TURN server, and thus provide the address of the
  271. # TURN server, the transport (udp/tcp/tls) to use, and a set of valid
  272. # credentials to authenticate...
  273. turn_server = "34.87.70.168"
  274. turn_port = 5349
  275. # turn_type = "udp"
  276. turn_user = "test"
  277. turn_pwd = "test"
  278.  
  279. # ... or you can make use of the TURN REST API to get info on one or more
  280. # TURN services dynamically. This makes use of the proposed standard of
  281. # such an API (https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00)
  282. # which is currently available in both rfc5766-turn-server and coturn.
  283. # You enable this by specifying the address of your TURN REST API backend,
  284. # the HTTP method to use (GET or POST) and, if required, the API key Janus
  285. # must provide.
  286. #turn_rest_api = "http://yourbackend.com/path/to/api"
  287. #turn_rest_api_key = "anyapikeyyoumayhaveset"
  288. #turn_rest_api_method = "GET"
  289.  
  290. # You can also choose which interfaces should be explicitly used by the
  291. # gateway for the purpose of ICE candidates gathering, thus excluding
  292. # others that may be available. To do so, use the 'ice_enforce_list'
  293. # setting and pass it a comma-separated list of interfaces or IP addresses
  294. # to enforce. This is especially useful if the server hosting the gateway
  295. # has several interfaces, and you only want a subset to be used. Any of
  296. # the following examples are valid:
  297. # ice_enforce_list = "eth0"
  298. # ice_enforce_list = "eth0,eth1"
  299. # ice_enforce_list = "eth0,192.168."
  300. # ice_enforce_list = "eth0,192.168.0.1"
  301. # By default, no interface is enforced, meaning Janus will try to use them all.
  302. #ice_enforce_list = "eth0"
  303.  
  304. # In case you don't want to specify specific interfaces to use, but would
  305. # rather tell Janus to use all the available interfaces except some that
  306. # you don't want to involve, you can also choose which interfaces or IP
  307. # addresses should be excluded and ignored by the gateway for the purpose
  308. # of ICE candidates gathering. To do so, use the 'ice_ignore_list' setting
  309. # and pass it a comma-separated list of interfaces or IP addresses to
  310. # ignore. This is especially useful if the server hosting the gateway
  311. # has several interfaces you already know will not be used or will simply
  312. # always slow down ICE (e.g., virtual interfaces created by VMware).
  313. # Partial strings are supported, which means that any of the following
  314. # examples are valid:
  315. # ice_ignore_list = "vmnet8,192.168.0.1,10.0.0.1"
  316. # ice_ignore_list = "vmnet,192.168."
  317. # Just beware that the ICE ignore list is not used if an enforce list
  318. # has been configured. By default, Janus ignores all interfaces whose
  319. # name starts with 'vmnet', to skip VMware interfaces:
  320. ice_ignore_list = "vmnet"
  321.  
  322. # In case you want to allow Janus to start even if the configured STUN or TURN
  323. # server is unreachable, you can set 'ignore_unreachable_ice_server' to true.
  324. # WARNING: We do not recommend to ignore reachability problems, particularly
  325. # if you run Janus in the cloud. Before enabling this flag, make sure your
  326. # system is correctly configured and Janus starts after the network layer of
  327. # your machine is ready. Note that Linux distributions offer such directives.
  328. # You could use the following directive in systemd: 'After=network-online.target'
  329. # https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Before=
  330. #ignore_unreachable_ice_server = true
  331. }
  332.  
  333. # You can choose which of the available plugins should be
  334. # enabled or not. Use the 'disable' directive to prevent Janus from
  335. # loading one or more plugins: use a comma separated list of plugin file
  336. # names to identify the plugins to disable. By default all available
  337. # plugins are enabled and loaded at startup.
  338. plugins: {
  339. #disable = "libjanus_voicemail.so,libjanus_recordplay.so"
  340. }
  341.  
  342. # You can choose which of the available transports should be enabled or
  343. # not. Use the 'disable' directive to prevent Janus from loading one
  344. # or more transport: use a comma separated list of transport file names
  345. # to identify the transports to disable. By default all available
  346. # transports are enabled and loaded at startup.
  347. transports: {
  348. #disable = "libjanus_rabbitmq.so"
  349. }
  350.  
  351. # As a core feature, Janus can log either on the standard output, or to
  352. # a local file. Should you need more advanced logging functionality, you
  353. # can make use of one of the custom loggers, or write one yourself. Use the
  354. # 'disable' directive to prevent Janus from loading one or more loggers:
  355. # use a comma separated list of logger file names to identify the loggers
  356. # to disable. By default all available loggers are enabled and loaded at startup.
  357. loggers: {
  358. #disable = "libjanus_jsonlog.so"
  359. }
  360.  
  361. # Event handlers allow you to receive live events from Janus happening
  362. # in core and/or plugins. Since this can require some more resources,
  363. # the feature is disabled by default. Setting broadcast to yes will
  364. # enable them. You can then choose which of the available event handlers
  365. # should be loaded or not. Use the 'disable' directive to prevent Janus
  366. # from loading one or more event handlers: use a comma separated list of
  367. # file names to identify the event handlers to disable. By default, if
  368. # broadcast is set to yes all available event handlers are enabled and
  369. # loaded at startup. Finally, you can choose how often media statistics
  370. # (packets sent/received, losses, etc.) should be sent: by default it's
  371. # once per second (audio and video statistics sent separately), but may
  372. # considered too verbose, or you may want to limit the number of events,
  373. # especially if you have many PeerConnections active. To change this,
  374. # just set 'stats_period' to the number of seconds that should pass in
  375. # between statistics for each handle. Setting it to 0 disables them (but
  376. # not other media-related events).
  377. events: {
  378. #broadcast = true
  379. #disable = "libjanus_sampleevh.so"
  380. #stats_period = 5
  381. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement