jb55 / lnsocket

A minimal C & js library for sending messages to lightning nodes
Other
61 stars 9 forks source link

more clarity on what this project is #19

Closed AndySchroder closed 11 months ago

AndySchroder commented 1 year ago

I don't understand what this project is. How can a browser directly speak lightning? Is there a proxy server required to translate the websockets connection to a lightning node socket connection? Or, have you come up with a way to speak directly with the node over websockets? Also, can I use this for arbitrary message exchange, or are there specific messages that can be sent? Does this onion route messages over the lightning network, or can it only connect directly to the peer?

jb55 commented 11 months ago

Or, have you come up with a way to speak directly with the node over websockets

Yes. A browser can speak lightning directly because CLN can talk the websockets protocol. proxy server is only needed for secure connections (see https://github.com/jb55/ln-ws-proxy)

Also, can I use this for arbitrary message exchange, or are there specific messages that can be sent

yes you can send custom messages as long as they use the lightning packet format.

Does this onion route messages over the lightning network, or can it only connect directly to the peer

Only direct connections until we add support for that, but would be more complex and require gathering gossip and routes.