hping
v0.2.1
Published
HTTP ping CLI with Node.js that sends HEAD or GET or POST requests to web or api servers and checks if they alive
Downloads
216
Maintainers
Readme
hPING (HTTP ping)
Node.js CLI that sends HTTP HEAD, GET, or POST requests to web/api servers.
Node.js Support
- Supported:
Node.js 20+(validated against current major runtimes, including Node22+).
Installation
hPING is installable via npm:
$ npm install hping -gUsage
hPING single server www.google.com:
$ hping www.google.comhPING server www.google.com with a 10-second interval:
$ hping www.google.com -i 10hPING single server with GET method:
$ hping get www.google.comhPING multiple servers:
$ hping www.google.com www.apple.com www.microsoft.comhPING group of servers from config file (default config: ~/.hping/hping.conf.yaml):
$ hping "apple production"hPING can mix group of servers and separate hosts with single command:
$ hping "apple production" www.github.comExplicit ping command (modern style):
$ hping ping www.google.comSettings
hPING default settings (~/.hping/hping.conf.yaml):
interval: 1 # (seconds) interval between hPING requests
type: HEAD # (type or requests): HEAD, GET, POST, PUT
timeout: 5000 # (milliseconds) request connection timeout
use_colors: true # (true || false), use colors for hPING output
show_stats_for_last: 100 # (number of requests) show hPING statistics for last X number of requests, set 0 to disable
max_run_time: 600 # (seconds) hPING maximum running time, set 0 to disable
log_status_change: false # (true || false) if true, hPING will log status changes to log file
log_file: logs/hping.log # (path) to hPING log file, default path in users home .hping folder
log_stats_on_exit: true # (true || false) if true, hPING will log statistics to file on exit
display_in_output: # use true || fasle to turn on/off log output sections
status: true
url: true
ip: true
type: false
status_code: true
status_info: true
server: true
content_length: false
response_time: trueShow hPING server groups:
$ hping serversDisplay hPING current settings:
$ hping settingshPING server www.google.com with custom config:
$ hping www.google.com -c /etc/hping.conf.yamlHelp
hPING quick usage help:
$ hping
usage: hping [ping|head|get|post] [http(s)://]www.webserver.com[:port] [another host] [server group]hPING full help:
$ hping -hLog to file
Enable status-change logging with log_status_change: true.
Default log file location: ~/.hping/logs/hping.log (override with log_file).
Development
Install deps:
$ npm installRun tests:
$ npm test##License The MIT License (MIT) Copyright (c) 2014 Sergey Kurdin
