Parity-ethereum: --jconrpc-cors setting not allowing access from server's public IP

Created on 1 Apr 2017  ·  1Comment  ·  Source: openethereum/parity-ethereum

After working with the application that is making use of Parity, I think this bug is a Parity bug so I am posting here. The scenario:

Parity is running on a VPS with the following invocation:
./parity --chain dev --jsonrpc-interface 0.0.0.0 --jsonrpc-hosts all --jsonrpc-cors http://127.0.0.1:8000 --jsonrpc-apis web3,eth,rpc --networkid "11321" --force-ui --ui-no-validation --log-file /var/log/parity.log

Then I am running an apache2 reverse proxy to port 8000 so that I can use the following application:

I am running the carsenk/explorer Blockchain Explorer and it works great on localhost. But I cannot access it via the public IP. I have changed the "--jsonrpc-cors" flag to read "--jsonrpc-cors http://:8000" and the only change was that the explorer was no longer visible on localhost, but was still not visible publicly.

So after much testing I think the problem is that parity refuses to accept any --jsonrpc-cors flags other than localhost.

Or maybe I'm completely wrong. :) So many variables.

Is there another way to test this --jsonrpc-cors flag?

Z1-question 🙋‍♀️

Most helpful comment

--jsonrpc-cors setting should be equal to an URL you will see in your browser when accessing the app.

So if you see http://localhost:8080 then you need to set --jsonrpc-cors http://localhost:8080 if you want to be able to acces over http://192.168.0.1:8080 as well the setting should be --jsonrpc-cors http://localhost:8080,http://192.168.0.1:8080.
If you prefer to allow all Origins to access the RPC you can set --jsonrpc-cors all. We don't support a whitelist for "every app running on port 8080", you will need to list all hosts manually.

>All comments

--jsonrpc-cors setting should be equal to an URL you will see in your browser when accessing the app.

So if you see http://localhost:8080 then you need to set --jsonrpc-cors http://localhost:8080 if you want to be able to acces over http://192.168.0.1:8080 as well the setting should be --jsonrpc-cors http://localhost:8080,http://192.168.0.1:8080.
If you prefer to allow all Origins to access the RPC you can set --jsonrpc-cors all. We don't support a whitelist for "every app running on port 8080", you will need to list all hosts manually.

Was this page helpful?
0 / 5 - 0 ratings