<p>After a lot of research I found the solution to my problem. </p>

<p>I didn't know this, but in nodejs there's a huge difference if your server runs on <code>127.0.0.1</code> and on <code>0.0.0.0</code>. </p>

<p>It isn't said in the lightning-charge docs, but except the <strong>--port</strong> attribute you also have <strong>--host</strong> which you can set.</p>

<p>Starting <strong>lightning-charge</strong> with this line <code>charged --api-token mySecretToken --host 0.0.0.0</code> fixed all of my problems. Gosh was that an unpleasant journey!</p>

CC BY-SA 3.0
2018-04-19T20:14:40.313Z
127.0.0.1 is the loopback address (also known as localhost). ... If a host has two ip addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host listens on 0.0.0.0, it will be reachable at both of those IPs.
Tailer
CC BY-SA 3.0
2018-04-19T16:42:20.473Z
2018-04-19T16:42:20.473Z
Reath
<p>My setup is a little bit complicated and I'm almost sure that my problem is port related.</p>

<p>So I'm running Mac OS X 10.13.4 with Parallels Desktop with a Ubuntu 14.04 VM. I managed to <strong>setup bitcoin core</strong> in the VM, on top of it I installed <strong>c-lightning</strong> and managed to fund it with btc (All is happening on the <strong>testnet</strong>) which I used to <strong>open one channel</strong> with some random other node. Everything is perfect for now.</p>

<p>Because I want to use the LApp for WordPress Lightning-Publisher I Installed <strong>lightning-charge</strong> and started an HTTP server running on the default port 9112. All of my ports are correctly forwarded and in my bitcoin.conf file I have allowed all ips. If I run Mozilla in my Ubuntu VM and go to <code>http://api-token:mySecretToken@localhost:9112/info</code> everything is fine, but when I try this on my Mac I get <code>Can't open the page because the server unexpectedly dropped the connection</code>. If I try using my external ip it's the same thing. </p>

<p>Using several sites to check if my ports are correctly forwarded I get that all corresponding ports are open (18332 for BTC core, 9735 for c-lightning and 9112 for lightning-charge).</p>

<p>Here is my bitcoin.conf</p>

<pre>
testnet=1
server=1
rpcallowip=0.0.0.0/0
rpcuser=someuser
rpcpassword=somepass

addnode=104.237.131.138
addnode=151.80.205.132
addnode=192.155.82.123
addnode=74.220.255.190
addnode=80.100.203.151
</pre>

<p>here is my lightning config</p>

<pre>
network=testnet
alias=IVCHOBIVCHO
port=9735
rgb=008000
</pre>

<p>Proof that 9112 is open:
<a href="https://i.sstatic.net/LE14R.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LE14R.png" alt="port open"></a></p>

<p>Proof that lightning-charge opens from inside the VM:
<a href="https://i.sstatic.net/FABJ0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FABJ0.png" alt="inside VM"></a></p>

<p>And in Safari on my mac (using localhost:9112 returns the same error):
<a href="https://i.sstatic.net/OseBW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OseBW.png" alt="in safari"></a></p>

<p>Neither Ubuntu, nor my Mac are under any kind of Firewall. My router is TP-Link</p>

<bitcoin-core><lightning-network><core-lightning>
Unable to remotely access lightning-charge
Reath
# Unable to remotely access lightning-charge

(Asked by: username_0 on 2018-04-19)

My setup is a little bit complicated and I'm almost sure that my problem is port related.

So I'm running Mac OS X 10.13.4 with Parallels Desktop with a Ubuntu 14.04 VM. I managed to **setup bitcoin core** in the VM, on top of it I installed **c-lightning** and managed to fund it with btc (All is happening on the **testnet**) which I used to **open one channel** with some random other node. Everything is perfect for now.

Because I want to use the LApp for WordPress Lightning-Publisher I Installed **lightning-charge** and started an HTTP server running on the default port 9112. All of my ports are correctly forwarded and in my bitcoin.conf file I have allowed all ips. If I run Mozilla in my Ubuntu VM and go to `http://api-token:mySecretToken@localhost:9112/info` everything is fine, but when I try this on my Mac I get `Can't open the page because the server unexpectedly dropped the connection`. If I try using my external ip it's the same thing.

Using several sites to check if my ports are correctly forwarded I get that all corresponding ports are open (18332 for BTC core, 9735 for c-lightning and 9112 for lightning-charge).

Here is my bitcoin.conf

```

testnet=1
server=1
rpcallowip=0.0.0.0/0
rpcuser=someuser
rpcpassword=somepass

addnode=104.237.131.138
addnode=151.80.205.132
addnode=192.155.82.123
addnode=74.220.255.190
addnode=80.100.203.151

```

here is my lightning config

```

network=testnet
alias=IVCHOBIVCHO
port=9735
rgb=008000

```

Proof that 9112 is open:
[![port open](https://i.sstatic.net/LE14R.png)](https://i.sstatic.net/LE14R.png)

Proof that lightning-charge opens from inside the VM:
[![inside VM](https://i.sstatic.net/FABJ0.png)](https://i.sstatic.net/FABJ0.png)

And in Safari on my mac (using localhost:9112 returns the same error):
[![in safari](https://i.sstatic.net/OseBW.png)](https://i.sstatic.net/OseBW.png)

Neither Ubuntu, nor my Mac are under any kind of Firewall. My router is TP-Link

**Tags:** bitcoin-core, lightning-network, core-lightning


---

## 1 answers

### Answer by username_0 on 2018-04-19. Score: 3

After a lot of research I found the solution to my problem.

I didn't know this, but in nodejs there's a huge difference if your server runs on `127.0.0.1` and on `0.0.0.0`.

It isn't said in the lightning-charge docs, but except the **--port** attribute you also have **--host** which you can set.

Starting **lightning-charge** with this line `charged --api-token mySecretToken --host 0.0.0.0` fixed all of my problems. Gosh was that an unpleasant journey!

> **Comments:**
> **username_1**: 127.0.0.1 is the loopback address (also known as localhost). ... If a host has two ip addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host listens on 0.0.0.0, it will be reachable at both of those IPs.  

---

