https://github.com/nabeken/mikoi
mikoi is a HAProxy's proxy protocol enabler for command line tools.
https://github.com/nabeken/mikoi
go haproxy haproxy-proxy-protocol monitoring-plugins proxies proxyprotocol
Last synced: 20 days ago
JSON representation
mikoi is a HAProxy's proxy protocol enabler for command line tools.
- Host: GitHub
- URL: https://github.com/nabeken/mikoi
- Owner: nabeken
- License: bsd-3-clause
- Created: 2015-06-12T16:26:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-10-30T07:08:56.000Z (over 2 years ago)
- Last Synced: 2025-03-17T16:21:11.372Z (about 1 month ago)
- Topics: go, haproxy, haproxy-proxy-protocol, monitoring-plugins, proxies, proxyprotocol
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 12
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mikoi
[](https://github.com/nabeken/mikoi/actions/workflows/go.yml)
mikoi is a [HAProxy's proxy protocol](http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt) enabler for command line tools.
It is designed to work to monitor ProxyProtocol enabled server with usual monitoring plugins such as nagios-plugins and sensu-plugins.
In normal situation, existing monitoring plugins can not monitor ProxyProtocol enabled server without modifications.
mikoi launches a proxy server lisening to an [ephemeral port](http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html) (dynamically allocated port) and forks a plugin with passing the port number to let the pluging connect to that port.
mikoi adds a ProxyProtocol header to traffic comes from a plugin and proxies to real server.
```text
+----------+
+---> | plugin | forked by mikoi
| +----------+
| /|\ |
| | |
| | \|/
| +---------+ +----------+
| | | <--------- | |
+----- | mikoi | | server | (proxy protocol enabled)
| | ---------> | |
+---------+ w/ header +----------+
```## Installation
Download from [releases](https://github.com/nabeken/mikoi/releases).
Or
```sh
go get -u github.com/nabeken/mikoi
```## Usage
```sh
$ mikoi -h
Usage:
mikoi [OPTIONS]Application Options:
-H, --hostname= host name
-p, --port= port number
-t, --timeout= connection times out (default: 10s)
-V, --verbose verbose
-P, --proxyproto use ProxyProto
--proxyproto-src= Source address for ProxyProtoHelp Options:
-h, --help Show this help message
``````sh
$ mikoi \
-P \
-H smtp.example.com \
-p 25 \
-- /usr/lib/nagios/plugins/check_smtp -H 127.0.0.1 -p {} -w 0.5 -c 1.0
````{}` will be replaced with an ephemeral port that mikoi is listening to.
If you omit command line arguments for plugin, mikoi runs in proxy server mode:
```sh
$ mikoi -V -H smtp.example.com -p 25 -P
cmd args: []
mikoi is now running as proxy server mode
mikoi is now listening to 63568
mikoi is launching server// You can connect to 63568 by any clients
$ telnet 127.0.0.1 63568
```