Download the PHP package ilyagvc/checkhost without Composer
On this page you can find all versions of the php package ilyagvc/checkhost. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package checkhost
CheckHost PHP
CheckHost PHP is a lightweight PHP wrapper for interacting with the check-host.net API, allowing you to run PING, HTTP, TCP, UDP, DNS, TRACEROUTE checks from a variety of global nodes. It includes flexible country/node filtering and comprehensive result parsing.
✅ Features
- Get real-time availability data from multiple global nodes
- Supports:
ping,http,tcp,udp,dns,traceroute - Filter nodes by country code, country name, or domain
- Collect results from specific or all available nodes
- Parse and structure response data (avg/min/max ping, jitter, status, etc.)
📦 Installation
Install via Composer:
🧱 Constructor
Parameters:
| Parameter | Type | Description |
|---|---|---|
$selectedCountries |
array, null |
Country name(s), ISO country code(s), or node domain(s) to include/exclude (null = all available nodes) (default = null) |
$except |
bool |
If true, excludes the specified countries instead of including them (default = false) |
$proxy |
string, null |
Optional proxy for curl requests (default = null) |
$timeout |
int |
Request timeout (seconds) for waiting on test results (default = 60) |
🔧 Methods
setCountry(array|null $countries = null, bool $except = false): bool
Filters nodes based on country names, codes, or node domains.
| Parameter | Type | Description |
|---|---|---|
$countries |
array, null |
Country name(s), ISO country code(s), or node domain(s) to include/exclude (null = all available nodes) (default = null) |
$except |
bool |
If true, excludes the specified countries instead of including them (default = false) |
getNodes(): array
Returns the currently selected and filtered node list.
No parameters.
getNodesIp(): array|false
Fetches the raw IP list of all available nodes from check-host.net.
No parameters.
updateNodes(): bool
Refreshes and re-applies node filters to fetch the latest node list.
No parameters.
sendRequest(string $host, string $type, int $maxNodes = 0): string|false
Sends a check request of a given type to selected nodes.
| Parameter | Type | Description |
|---|---|---|
$host |
string |
The target domain or IP to check |
$type |
string |
Type of check: one of ping, http, tcp, udp, dns, traceroute |
$maxNodes |
int |
Maximum number of nodes to use. Any value other than 0 overrides the selected nodes and uses up to the specified number of available nodes (0 = use selected nodes) (default = 0) |
getResults(string $requestId): array|false
Fetches the result of a previously sent check request.
| Parameter | Type | Description |
|---|---|---|
$requestId |
string |
ID returned by sendRequest() |
runCheck(string $host, string $type, int $maxNodes = 0): array|false
Combines sendRequest() and getResults() into a single call, returning structured data.
| Parameter | Type | Description |
|---|---|---|
$host |
string |
The target domain or IP to check |
$type |
string |
Type of check: one of ping, http, tcp, udp, dns, traceroute |
$maxNodes |
int |
Maximum number of nodes to use. Any value other than 0 overrides the selected nodes and uses up to the specified number of available nodes (0 = use selected nodes) (default = 0) |
fullCheck(string $host): array|false
Performs all checks (ping, http, tcp, udp, dns, traceroute) on the given host.
| Parameter | Type | Description |
|---|---|---|
$host |
string |
The target domain or IP to check |
setProxy(string $proxy): void
Sets or updates a proxy to be used for all cURL HTTP requests.
| Parameter | Type | Description |
|---|---|---|
$proxy |
string |
Proxy address, e.g., http://127.0.0.1:8080 |
setTimeout(int $seconds): void
Sets the timeout for all result fetching requests.
| Parameter | Type | Description |
|---|---|---|
$seconds |
int |
Timeout duration in seconds |
📦 Example Usage
Ping Check
Sample Output (Simplified)
Full Check
Sample Output (Simplified)
🌐 Node Filtering
Filter to only Germany and Austria nodes:
Exclude France:
🔄 Proxy & Timeout
📄 License
MIT
📬 Contact
Developed by ILYAGVC Feel free to open issues or PRs!