I'm building a NodeJS application that uses REST services for data. That is, I want to GET
and POST
data from a Node instance running on port 80 to an ASP.NET Core web server running on the same physical server.
I get that I can proxy all calls from a directory like /mysite.com/api/products
to some port like /mysite.com:5000/products
from my Node/Express side.
My question is if I do that, will I run into firewall problems assuming that the only incoming port on the Node server is 80? That is, externally I cannot access port 5000 but I do want my Node server to be able to hit the port 5000 which is what my ASP.NET Core server will be running on behind the firewall.
Finally, am I out to lunch in wanting to do this? My goal is simply to have my node javascript app do rest calls as simple as possible to my ASP.NET Core web site.
It isn't possible to provide a definitive answer since it depends on your network, your firewalls capabilities and how you've got everything configured.
That said, you could avoid most potential hiccups by simply using http://localhost
instead of a fully qualified domain http://example.com
. This will keep all of the traffic on the local loopback adapter so the traffic never actually leaves your server.