Download the PHP package ayaseensd/ip-checker without Composer
On this page you can find all versions of the php package ayaseensd/ip-checker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ayaseensd/ip-checker
More information about ayaseensd/ip-checker
Files in ayaseensd/ip-checker
Package ip-checker
Short Description A Laravel package to check IP access using cURL
License MIT
Informations about the package ip-checker
IP Checker
Overview
The Ayaseensd\IpChecker
package provides a Laravel console command that allows you to check the accessibility of specified IP addresses or IP ranges using TCP or UDP protocols. You can also specify the port to use for the connection tests.
Installation
To install the package, add it to your project via composer:
Once installed, register the service provider by adding it to the config/app.php
file (if needed):
Usage
The package provides a console command check:ip-access
, which can be used to test access to IP addresses or ranges.
Command Syntax
Example Usages
-
Check a single IP (TCP on default port 80):
-
Check a single IP using a specific port (e.g., 8080):
-
Check multiple IP addresses (default port 80):
-
Check a range of IPs (CIDR notation):
- Check using UDP instead of TCP:
Command Options
ips*
: IP addresses or IP ranges in CIDR notation to check (e.g.,192.168.1.0/24
).--port
: Specifies the port to use for the connection test. Defaults to port 80.--udp
: If set, the package will use the UDP protocol for testing, otherwise, TCP will be used by default.
How it Works
-
IP Range Support:
- The package supports individual IP addresses and IP ranges in CIDR notation. If a range is specified, it is expanded into individual IP addresses for testing.
-
Protocol Selection:
- You can choose either the TCP or UDP protocol for connection testing by using the
--udp
flag. By default, TCP is used.
- You can choose either the TCP or UDP protocol for connection testing by using the
-
Port Selection:
- By default, the connection tests use port 80. You can specify a different port using the
--port
option.
- By default, the connection tests use port 80. You can specify a different port using the
- Access Testing:
- The package uses the
stream_socket_client
function to attempt a connection to the specified IPs. If the connection is successful, it reports success; otherwise, it returns the error message.
- The package uses the
Output
- For each IP address tested, the command will display the result:
- If the IP is accessible, a success message will be shown.
- If the IP is not accessible, an error message with details will be displayed.
Example Output
License
This package is open-source and licensed under the MIT License.