Tidy up
Configured middleware server to run as a client as well as a server