communicate programically Dash coin core wallet
You should add 

rpcport=8666
rpcallowip=0.0.0.0/0


Working config file example: 

rpcuser=username
rpcpassword=strong_pass
rpcallowip=0.0.0.0/0
listen=0
daemon=1
server=1
txindex=1
timestampindex=1
rpcthreads=4
rpcport=8666


and make sure the port is already open from your internet provider side and your system firewall.