lnsocket

A minimal C library for connecting to the lightning network
git clone git://jb55.com/lnsocket
Log | Files | Refs | Submodules | README | LICENSE

commit ff6cad43eddecbd48a87a4f05a02eeb25912a37a
parent 19ebf64e2cc85cbe52d3f57ad2b777af84646914
Author: William Casarin <jb55@jb55.com>
Date:   Tue,  8 Mar 2022 18:07:06 -0800

apparently direct connections work ....

Diffstat:
Mlnsocket_example.js | 6++----
Mlnsocket_lib.js | 2+-
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lnsocket_example.js b/lnsocket_example.js @@ -4,10 +4,8 @@ async function go() { const ln = LNSocket() ln.genkey() - const their_init = await ln.connect_and_init("03f3c108ccd536b8526841f0a5c58212bb9e6584a1eb493080e7c1cc34f82dad71", "cln.jb55.com:443") - - const pong = await ln.ping_pong() - console.log("pong", pong) + //const their_init = await ln.connect_and_init("03f3c108ccd536b8526841f0a5c58212bb9e6584a1eb493080e7c1cc34f82dad71", "cln.jb55.com:443") + await ln.connect_and_init("03f3c108ccd536b8526841f0a5c58212bb9e6584a1eb493080e7c1cc34f82dad71", "24.84.152.187:8324") const rune = "CVFjq11ZtQ-V14SOeQyV4V2AicYZnHfbBNY8lqYvf8c9NjcmbWV0aG9kPWdldGluZm8mdGltZTwxNjQ2ODc2MTU2" const res = await ln.rpc({ method: "getinfo", rune }) diff --git a/lnsocket_lib.js b/lnsocket_lib.js @@ -235,7 +235,7 @@ async function lnsocket_init() { } function handle_connect(ln, node_id, host) { - const ws = new WebSocket(`wss://${host}`) + const ws = new WebSocket(`ws://${host}`) return new Promise((resolve, reject) => { ws.onmessage = (v) => { ln.queue.push(v.data.arrayBuffer())