0

I have some http testing tools written in node.js that I'm using to test my kestrel server on localhost. Node.js makes the request but then seems to hang and timeout. I can see in the kestrel logs that the http request is made, and making the request to the local kestrel server using postman and other client tools seem to work.

Why does making the http request using node.js hang on the return? It seems successful in making the request to the server, but is it waiting for some sort of http end to return?

It works fine if I deploy the service to azure and I hit the same service over the internet - it only hangs when it's on localhost and the client is node.js.

here's my node.js code

describe('homepage', function(){
    it('should respond to GET',function(done){
    superagent
        .get('http://localhost:5000/message')
        .end(function(err, res){
            expect(res.status).to.equal(200);
            done()
        })
    })
});

and my simple asp core/5 web api which runs fine on localhost

   [Route("/message")]
    public class MessageController : Controller
    {
        [HttpGet]
        public string Get()
        {
            return "hello";
        }
    }
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460

0 Answers0