Linux 端口映射工具:rinetdplus
介紹 rinetdplus 之前,先介紹 rinetd。rinetd 是 Linux 下的端口映射工具,實現端口映射/轉發/重定向。簡單好用。
“Redirects TCP connections from one IP address and port to another. rinetd is a single-process server which handles any number of connections to the address/port pairs specified in the file /etc/rinetd.conf. Since rinetd runs as a single process using nonblocking I/O, it is able to redirect a large number of connections without a severe impact on the machine. This makes it practical to run TCP services on machines inside an IP masquerading firewall”.
rinetd 是用 select 來實現 多路I/O機制。
rinetdplus 所要做的,是在 rinetd 基礎上,用 epoll 來替代 select。它使用的是 redis 封裝的 一個簡單庫 ae。
附:README.md
# rinetdplus
rinetd + ae from redis
1 what is rinetd? see http://www.boutell.com/rinetd/
2 ae is "A simple event-driven programming library" from redis
3 what rinetdplus do ?
rinetd use function "select", rinetdplus replace it with "epoll" (ae).Just it.