Adds custom endpoint host option to agent

A custom endpoint hostname can now be passed as a configuration option to the agent.