Closed srl295 closed 8 years ago
The intention is that appEnv.url
should be good enough for this. The problem with this is - when running in CF - is that it will route HTTP requests back through the gorouter (and any other front-end provided by the CF installation), causing actual network traffic instead of a loopback through localhost, which wouldn't cause any network traffic.
So, you can imagine that this might be desired.
However, in such cases, if you really DID want to route right back to the same server instance you were invoked with, then it seems like you could easily avoid HTTP altogether.
So, wondering what the real use case is.
Also, a little worried that resolving localhost:$PORT
would not always work - I would certainly HOPE that it would, but I'm not sure anyone does this, so seems like an edge case that could go bad at some point.
There's no requirement that localhost
or 127.0.0.1
exist or work. However if bind is 0.0.0.0
then any network interface should work.
It's not a great use case, but node-uptime tries to call itself using http://<localhost>:<port>/api/<something>
.
I'm confused on what the real need is here. What are the use cases, and expected results?
closing because of lack of interest; feel free to re-open
If an app wants to call itself, could there be a
localUrl
property that is something like:Perhaps instead of
localhost
it should be<bind>
, unless<bind>
is 0.0.0.0 in which caselocalhost
is still appropriate?