--remote-limit-api also filters local calls
When IRI v 1.1.2.4 is started with the --remote-limit-api command line parameter, the commands are also being blocked even if the call comes form the local loopback interface:
"COMMAND getNeighbors is not available on this node" is received when an explicit call is made to http://127.0.0.1:14265
The same behaviour happens if IPv6 is used http://[::1]:14265 or the usual moniker http://localhost:14265
The command filter should block access only to those requests coming from non-node ip addresses, right?
This could be OS-specific behaviour, as I only have tested it Windows. IRI was directly compiled from source using maven 3.3.9 and JDK 1.8.121

Example of output using unmodified console.html on Chrome running on the node
Just to make sure, here's the initiating command line:
java -jar iri-1.1.2.4.jar -p 14265 -r 14265 --remote-limit-api "addNeighbors, removeNeighbors, getNeighbors, interruptAttachingToTangle, attachTotangle" --remote -e -n "....."
I can Confirm that this issue is not Windows specific. I experience the same problem on Ubuntu 16.04
Try with this branch: https://github.com/iotaledger/iri/tree/fixRemoteApiLimit
Solved in https://github.com/iotaledger/iri/commit/c8a0d942be90eeb067edbbe00b878bc25a10d63b
Test with self-compiled jar and with jar provided by Paul, the issue remains, at least in Windows Going to test further to make sure I'm not forgetting anything, but after testing with that last jar that was supplied, I'm pretty sure the issue is not solved in this situation
@project-Shift please provide the startup command you are using, as well as what API calls you are attempting, if they are different from above.
no, same startup as above; several tests again, all the outcomes are the same, call is blocked.
I tested on Ubuntu 16.04 and successfully passed the getNeighbors API via localhost while remote call was blocked. Did not test on windows though
Also, I looked at you code, and although I'm not a dev, and don't know java, I would like to point out that in line 119, you might have used the actual loopback address instead of the "localhost" var !sourceAddress.getAddress().equals(InetAddress.getByName("localhost"))) transforms into !sourceAddress.getAddress().equals("127.0.0.1")) , at least just to diagnoze the fix?
The reason is simple: IPv6 , that happens to be active in my windows node Localhost resolves to IPv6 loopback, which is [::1] , so I'm not sure how that comparison will work.
My humble apologies if it's a stupid suggestion, just trying to help out, even though clueless ...
Mean while, I'll try with IPv6 off ...
could you try tossing System.out.format("source:%s\tlocalhost:%s",sourceAddress.getAddress().toString(), InetAddress.getByName("localhost").toString());
in line 118, and print out what the console debugger gives?
ups, not sure I quite follow those instructions :-/ Where and how should I do that?
Actually, try replacing
!sourceAddress.getAddress().equals(InetAddress.getByName("localhost")))
with the following:
!sourceAddress.getAddress().equals(InetAddress.getLocalHost()))
to the best of my current skill set, I looked up the api.java file in src, altered line 118 as per your request, did a new compile and packaging, replaced iri ... and the result is the same.
But these are uncharted waters for me! first time ever editing Java and 3th time only compiling ... so thread carefully :-D
thread carefully
I see what you did there.
I did that on my local node, ofc, not on git
btw, also tried my stupid suggestion with the same results, so ...
What's in C:\WINDOWS\system32\drivers\etc\hosts?
definitely related to IPv6, it seems I introduced sourceAddress.getAddress() and InetAddress.getByName("localhost") in the returned console message, to see what it was reading, and this is the result: sourceAddress.getAddress() = 0:0:0:0:0:0:0:1 <--- IPv6 loopback !!! InetAddress.getByName("localhost") = localhost/127.0.0.1
I suposedly already disabled IPv6 in this node, but since it's a core version, I might be missing something. Either way, this might explain why it's failing on my windows system