portagent project is a proxy routing daemon for sharing ports.
portagent is a POSIX transparent proxy routing daemon that allows multiple arbitrary services to run on a single arbitrary port. The main intention of portagent is for situations that need more services open to the world than open ports prohibit.
portagent works by analyzing the first input sent to the proxy (portagent) then, based on that input, forwards the connection to a defined location; this makes portagent more of an art than a science. certain protocols work well together, and the more services on a single port the more degradation may occur.
Some protocols expect the client to send data first, for example http/80 sends its request without expecting any data from the server, this is desired, and can be matched and forwarded immediately. on the other side a service like ssh/22 expects the server to send data first, for this portagent will 'tease' the client with a forwarded connection (using the TRY instruction listed further on) so that the server will send data to the client in an attempt to invoke a response from client to then be matched and forwarded.
The science part of portagent comes into play when using multiple TRY instructions to attempt to invoke a response from the client, by the second TRY instruction the connection will have invalid protocol data sent to it from the previous TRY, however this may or may not matter depending on the protocol. if a protocol is broken by this, it is usually easily noticeable when debugging/testing a portagent config file.
portagent config options have the following basic format: INSTRUCTION_NAME 'instruction_value', where instruction_value may contain the following escape codes: \, ', e, v, t, r, n, xNN, and NNN.
portagent config files themselves have a very flexible instruction hierarchy, a whole config file could be placed on one line with no spaces if needed. however, it is best understood in the following schema (format):
(items in '' indicate they are not required, '...' indicates allowance for multiple hierarchy instances, '|' indicates one of two choices)
What's New in This Release: [ read full changelog ]
· An issue with fseek() that caused portagent to fail when reading portagent.conf on some systems was fixed.
· An issue where CHROOT caused DNS resolution and "word" port definition failures was fixed.
· IF DEFINED arbitrary definitions were added: 'ascii', 'extended-ascii', 'readable', and 'unreadable'.
· An IF DEFINED explicit protocol definition was added: 'imap'.
· IF DEFINED definitions were revised to more broadly match protocols.