This may seem like a stupid question but is it possible to establish a connection between a webserver and a nodejs application? I know that I can make requests from the nodejs server but is it possible to do something the other way around?
Share
Assuming the webserver in question allows you to make outgoing network connections, you just use whatever features it has for doing so to connect to your node.js server and make a request, whether an HTTP request or some generic TCP request. For example, if the webserver were running PHP, you’d probably use the
cURLPHP module to make an HTTP connection, orfsockopen()along withfread()andfwrite()for a raw TCP connection.Note that some hosting arrangements may disallow outgoing connections.