The below haproxy.cfg file’s most important section is the listen section.
This allows haproxy to work on every IP address and wait for a connection on port 23.
Loops through connections 1 at a time through the list (based on weight)
Only handle tcp connections at port 23
server term01 127.0.0.1:6423
Creates a server labeled term01 (can be labled anything you want) and connect to it at 127.0.0.1 (localhost) at port 6423.
Allow only one connection at a time to the server
This sets priority. I put them in order in which I want them to connect. If weight 1 is open it’ll be connected to first, and go down the list until one is found open.
This checks the server intermittently to verify the server is up and running. I like having this to notify me when a server goes down via logging.
So the above is the /etc/haproxy/haproxy.cfg file to allow two DOSBOX BBS instances be cycled through. Each Dosbox instance has the serial setup like this: