PIVX-Project/PIVX

[Bug] rpcallowip (static ip does not work)

konlag opened this issue · 5 comments

I use pivx v5.3.3
rpcallowip=127.0.0.1 - working
other static ip does not work
example:
rpcallowip=94.156.11.7 - does not work
Works only from localhost successfully. I am using curl.

Hello,
Before anything else, would recommend you to not expose the JSON-RPC server to untrusted networks such as the public internet.

There are other solutions for this like: https://github.com/random-zebra/PIVX-NGINX_proxy . Where you can expose only certain commands, limit the access, connect through a TLS channel, among other nice features.

Saying that, if you still want to take the risk and expose your node's JSON-RPC server, you have to combine rpcbind, rpcallowip and server arguments in the pivx.conf and open the rpcport in your machine.

none of this works.
only local ip works (localhost)
check yourself..

add below 4 lines
rpcallowip= remote server ip
rpcallowip= node hosted IP
rpcbind= nodfe hosted ip
rpcbind= 127.0.0.1

To use rpcallowip you need same IP you are connecting from, you need rpcbind to be your server or home machine IP, if you don't want to use default port you must set rpcport.
Whichever port you use must open firewall to allow to connect to it.

Here is a demo, connecting from home to hosted on VPS (masked home IP)

image

image

image

Please close the issue, not a bug

@furszy I always wanted to write API wrapper to expose RPC over SSL, this PIVX Nginx Proxy is such a great idea. I'll look into that, Thanks!