| 1 |
[appendix] |
| 2 |
== Migrating from Ranch 1.6 to 1.7 |
| 3 |
|
| 4 |
Ranch 1.7 adds built-in support for the PROXY protocol. |
| 5 |
|
| 6 |
The PROXY protocol is a simple and efficient way for proxies |
| 7 |
to transmit information about the client. |
| 8 |
|
| 9 |
While a third-party library already existed, it was not |
| 10 |
entirely compatible with the Ranch interface, in particular |
| 11 |
when socket active mode was involved. This new implementation |
| 12 |
fixes that and supports the full protocol with as little |
| 13 |
overhead as possible compared to normal operations: just one |
| 14 |
extra function call. |
| 15 |
|
| 16 |
Ranch 1.7 is compatible with Erlang/OTP 19.0 onward. Support |
| 17 |
for Erlang/OTP 18 has been removed. |
| 18 |
|
| 19 |
=== Features added |
| 20 |
|
| 21 |
* Full support for the PROXY protocol was added. |
| 22 |
|
| 23 |
=== New functions |
| 24 |
|
| 25 |
* Add the function `ranch:recv_proxy_header/2` to receive |
| 26 |
the PROXY protocol header and parse it. It must be called |
| 27 |
before `ranch:handshake/1,2`. |
| 28 |
|
| 29 |
* Add the functions `ranch_proxy_header:parse/1` and |
| 30 |
`ranch_proxy_header:header/1,2` to parse and build a |
| 31 |
PROXY protocol header, respectively. |
| 32 |
|
| 33 |
=== Bugs fixed |
| 34 |
|
| 35 |
* Fix a race condition when the listener is restarted |
| 36 |
after `ranch_listener_sup` crashes. This resulted in |
| 37 |
the original options being used even if the options |
| 38 |
were updated at runtime. |
| 39 |
|
| 40 |
* Make the acceptors exit instead of crash when the |
| 41 |
listening socket has been closed to prevent |
| 42 |
unnecessary logs. |
| 43 |
|
| 44 |
* Fix an issue where listener information would not get |
| 45 |
cleaned up when an embedded listener was stopped. This |
| 46 |
was fixed in Ranch 1.6.2. |