Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ipFamily

Check whether an address is IPv4 or IPv6


Description

Given an IP address, this checks whether it is an IPv4 or IPv6 address.

Usage

ipFamily(ip)

Arguments

ip

A single string representing an IP address.

Value

For IPv4 addresses, 4; for IPv6 addresses, 6. If the address is neither, -1.

Examples

ipFamily("127.0.0.1")   # 4
ipFamily("500.0.0.500") # -1
ipFamily("500.0.0.500") # -1

ipFamily("::")          # 6
ipFamily("::1")         # 6
ipFamily("fe80::1ff:fe23:4567:890a") # 6

httpuv

HTTP and WebSocket Server Library

v1.6.1
GPL (>= 2) | file LICENSE
Authors
Joe Cheng [aut], Winston Chang [aut, cre], RStudio, PBC [cph], Hector Corrada Bravo [ctb], Jeroen Ooms [ctb], Andrzej Krzemienski [cph] (optional.hpp)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.