javascript - Make one node.js web server at host1 call a function in another node.js web server at host2 and return the result to web client -


i have 2 node.js web servers running in different hosts - host1 , host2. when web client using web server @ host1 requests data, web server in host1 1 check owner of data - whether data resides @ host1 or host2. host1 has ability find owner of data request. if data available @ host1 itself, fetch , return data web client.

but if data available @ host2, how make web server @ host1 call similar function (to fetch data) in web server @ host2 , return result web client.

i have seen examples connect 2 node.js servers using tcp sockets. don't know how return result web client on message received instead of logging in console.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -