2

say I have a JSP-script on a server that's called from the browser. This script internally calls another source to get some data.

This internal source is a script that's on the same machine. I

s it possible to do a simple HTTP-GET-Request to that script or does the HTTP-request "leave" the current machine and "returning" to it again (so that it's possible to see/manipulate that request from outside) or is the request handled totally within the current server?

acme
  • 667
  • 1
  • 7
  • 13

4 Answers4

2

as already mentioned the connection is not leaving the server. but you should try to avoid using the http request for performance/design/... reasons. when the source is in the same app/webserver, you should access it directly without doing the detour over http.

Christian
  • 4,645
  • 2
  • 23
  • 27
  • Optimizing for performance is a trap, and using HTTP as your interface is always good design as RESTful HTTP interfaces are universal. – Ace.C Nov 08 '21 at 22:59
2

It is completely acceptable. Things like edge-side includes, webhooks, and Deliverance encourage using http for integration.

To be sure the internal request won't appear on the network, you can bind both the internal source's listener socket and the server's client socket to 127.0.0.1.

Tobu
  • 4,367
  • 1
  • 23
  • 31
1

If the request is initiated from the same machine to the same machine, it will not leave it and will be handled locally. In other words, it's not possible to snoop it from the outside.

rytis
  • 2,324
  • 1
  • 18
  • 13
0

If the server has bound a socket to the local network interface then this should be easy.

ta.speot.is
  • 842
  • 5
  • 9