Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
What happens if your server does XHR to itself?

I was digging into server side rendering with Angular this week. It seems architected to be totally isomorphic, so if you are getting data on the server or the client, it's the same line of code that runs. Therefore it would make a call like this.http.get('http://www.example.com/myurl'); where this.http would be an instance of Http from @angular/http.

On the client side, this is super clear. It means the browser is making an XHR request to my server.

On the server side... what is actually happening behind the scenes? I imagine the node server, being completely unaware of its domain, will make a regular http request, with DNS lookup and everything, just to find itself?

Is that accurate?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

All comments point to the answer of the question being that your server will reach out for DNS call to come back and hit itself.

Since I was curious about this to know about performance, I did a test like this: time curl -v http://[mydomain].us-east-1.elb.amazonaws.com/testedself.

The endpoint is just an express endpoint with res.send('Hello World');. The extra time is ~10MS in this specific test.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!