Added functionality to headless mode

Needs to change the network port at constructor, but it works!