in reply to How can I determine whether a URI, hostname or IP address is to the local host machine?
So the infinite recursion can only happen if the script that makes the HTTP request is actually calling itself (maybe on a different host)? Could you give each script and/or host some kind of unique identifier that it places in any request it makes (HTTP header, cookie, GET parameter, something), and if a script sees its own ID it stops the recursion? Or a more general solution, some kind of "Time To Live" HTTP header that gets decremented each time your script forwards a request?
In terms of determining the local machine's IP address(es), I've used IO::Interface::Simple a few times for that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I determine whether a URI, hostname or IP address is to the local host machine?
by dbooth (Novice) on Apr 29, 2014 at 20:47 UTC | |
by Anonymous Monk on Apr 29, 2014 at 22:33 UTC | |
by dbooth (Novice) on Apr 30, 2014 at 01:46 UTC |