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



here is my lightning config


Proof that 9112 is open: port open

Proof that lightning-charge opens from inside the VM: inside VM

And in Safari on my mac (using localhost:9112 returns the same error): in safari

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

1 Answer 1


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 and on

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 fixed all of my problems. Gosh was that an unpleasant journey!

  • is the loopback address (also known as localhost). ... If a host has two ip addresses, and, and a server running on the host listens on, it will be reachable at both of those IPs.
    – Tailer
    Apr 19, 2018 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.