# `RemoteIp.Parsers.Generic`
[🔗](https://github.com/ajvondrak/remote_ip/blob/main/lib/remote_ip/parsers/generic.ex#L1)

Generic parser for forwarding headers.

This module implements the `RemoteIp.Parser` behaviour. When there is not a
more specific parser, `RemoteIp.Headers.parse/1` falls back to using this
one.

The value is parsed simply as a comma-separated list of IPs. This is suitable
for a wide range of headers, such as `X-Forwarded-For`, `X-Real-IP`, and
`X-Client-IP`.

Any amount of whitespace is allowed before and after the commas, as well as
at the beginning & end of the input.

## Examples

    iex> RemoteIp.Parsers.Generic.parse("1.2.3.4, 5.6.7.8")
    [{1, 2, 3, 4}, {5, 6, 7, 8}]

    iex> RemoteIp.Parsers.Generic.parse("  ::1  ")
    [{0, 0, 0, 0, 0, 0, 0, 1}]

    iex> RemoteIp.Parsers.Generic.parse("invalid")
    []

---

*Consult [api-reference.md](api-reference.md) for complete listing*
