This commit changes the server's default behavior to omit STUN error
reason phrases in responses. A new option, `--send-error-reason` (and
corresponding config file setting `send-error-reason`), is introduced
to enable the inclusion of these reason phrases if desired.
This change aims to reduce response size by default, while still
allowing you to enable more verbose error messages for debugging.
Changes include:
- Renamed `no_error_reason` to `send_error_reason` in `turn_params_t`.
- Default for `send_error_reason` is now `false` (reasons omitted).
- Command-line option changed to `--send-error-reason` to enable reasons.
- Updated `mainrelay.c` for new option name, logic, and usage string.
- Updated all `turnserver.conf` files (`examples/etc/turnserver.conf`,
`docker/coturn/turnserver.conf`) to reflect the new option and default.
- Adjusted conceptual test cases for the new default behavior.
- Partially updated `ns_turn_server.c` to use the new
`send_error_reason` flag. Due to some limitations I encountered, a full update
to `ns_turn_server.c` could not be reliably completed and will
require your manual review and completion to ensure all error generation
sites correctly adhere to the `send_error_reason` flag (sending
reasons only when it's true).
Deprecate `--no-stun-backward-compatibility` and set it to true by
default
Add new option `--stun-backward-compatibility`, off by default
Update example/recommended configuration files
This is a breaking change as passing `--no-stun-backward-compatibility`
will be rejected as invalid argument
Invert `--no-rfc5780` option to be true by default
Make it `--rfc5780` to enable it
Update example/recommended configuration files
Passing `--no-rfc5780` will have no effect as this is the default
behavior now
As part of looking at #1588 , I figured that sending `SOFTWARE`
attribute is also part of a problem as it increases messages sent out by
coturn and thus increasing amplification factor. For 4.6.2, the
additional size is 24 bytes (4 bytes attribute header, and 20 bytes for
"Coturn-4.6.2 'Gorst'")
If we are to use an example from #1588, "A 62 byte request will be met
with Coturn’s 401 Unauthorized response which is 150 bytes, a factor of
~2.42." - without SOFTWARE the response will be 126 bytes which reduces
amplification factor to ~2.
As I observed with multiple providers using coturn - some of the are
sending it. Meaning, they do not set `--no-software-attribute` - most
probably due to lack of clarity about this setting.
I believe sending SOFTWARE_ATTRIBUTE should be off by default which is
hinted in the RFC
(https://datatracker.ietf.org/doc/html/rfc8489#section-16.1.2)
Detailed changes:
- Extract setting the attribute into a function to avoid code
duplication
- This option is now not reloadable
- The option is now called `software_attribute` because inverse logic
creates multiple double-not in the code which makes it harder to read.
- `no-software_attribute` is still functional but marked as deprecated
in documentation
Test Plan:
- Run local tests with different cli arguments (new and deprecated) and
confirm SOFTWARE attribute is off by default, and added when arguments
say so
Implement a custom prometheus http handler in order to:
1. Support listening on a specified address as opposed to any
2. Remove the requirement on the unmaintained promhttp library
This feature comes with one limitation: if an IPv4 address is used, the
server will not listen on the IPv6-mapped address, even if IPv6 is
available. That is, dual-stacking does not work.
Solves: #1475
---------
Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
Fixes https://github.com/coturn/coturn/issues/1239
https to web ui freeze in browser if no_tls option used, because no tls
stuff initialized.
This PR add warning about this and comment aboute this in default config