ip_address_list

Version, currently 0.1.02 versions

github.com/mamantoha/ip_address_list

Retrieve the IP addresses (both IPv4 and IPv6) associated with the network interfaces on a system

1 stars
2 dependents
License: MIT

Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  ip_address_list:
    github: mamantoha/ip_address_list
    version: ~> 0.1.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.1.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

Crystal IP Address List Library

Crystal CI

This library provides functionality to retrieve the IP addresses (both IPv4 and IPv6) associated with the network interfaces on a system. It is a port of Ruby's ip_address_list method from the Socket class.

Features

  • Retrieve both IPv4 and IPv6 addresses from network interfaces.
  • Supports Windows, Linux, and macOS.
  • Easy-to-use interface, returning a list of Socket::IPAddress objects.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      ip_address_list:
        github: mamantoha/ip_address_list
  2. Run shards install

Usage

require "ip_address_list"

p! Socket.ip_address_list
# => [Socket::IPAddress(127.0.0.1:0),
#     Socket::IPAddress(192.168.31.229:0),
#     Socket::IPAddress(172.17.0.1:0),
#     Socket::IPAddress([::1]:0), Socket::IPAddress([fdcc:60fc:349d:2fcf:7e6:1635:e1a7:1fb6]:0),
#     Socket::IPAddress([fe80::c8e3:857d:43c8:cec3]:0)
#     ...]

Contributing

  1. Fork it (https://github.com/mamantoha/ip_address_list/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors