making port number configurable in HTTPAgent