Closed farscapian closed 1 year ago
As an update to this, I have an example implementation proposal for the back end side (for producing the direct links). Here's an example output:
bob (cln-1) connection info:
admin_rune: sJxl37j_Xd9pOKtIl-BIXN2JYYLjY1VEEH4bUatTXnk9Mzc=
p2p_uri: 03cc8c0b242e2ce8579138bf2c34c8238475946b147dc180e39323f0a385f4243d@127.0.0.1:9736
websocket_uri: 03cc8c0b242e2ce8579138bf2c34c8238475946b147dc180e39323f0a385f4243d@127.0.0.1:9836
websocket_proxy: ws://127.0.0.1:9836
p2p_query_string: ?type=p2p&uri=03cc8c0b242e2ce8579138bf2c34c8238475946b147dc180e39323f0a385f4243d@127.0.0.1:9736&rune=sJxl37j_Xd9pOKtIl-BIXN2JYYLjY1VEEH4bUatTXnk9Mzc=
websocket_query_string: ?type=websocket&uri=03cc8c0b242e2ce8579138bf2c34c8238475946b147dc180e39323f0a385f4243d@127.0.0.1:9836&websocket_proxy=ws://127.0.0.1:9836&rune=sJxl37j_Xd9pOKtIl-BIXN2JYYLjY1VEEH4bUatTXnk9Mzc=
base64_urlencoded_p2p_string: P3R5cGU9cDJwJnVyaT0wM2NjOGMwYjI0MmUyY2U4NTc5MTM4YmYyYzM0YzgyMzg0NzU5NDZiMTQ3%0AZGMxODBlMzkzMjNmMGEzODVmNDI0M2RAMTI3LjAuMC4xOjk3MzYmcnVuZT1zSnhsMzdqX1hkOXBP%0AS3RJbC1CSVhOMkpZWUxqWTFWRUVINGJVYXRUWG5rOU16Yz0%3D
base64_urlencoded_websocket_string: P3R5cGU9d2Vic29ja2V0JnVyaT0wM2NjOGMwYjI0MmUyY2U4NTc5MTM4YmYyYzM0YzgyMzg0NzU5%0ANDZiMTQ3ZGMxODBlMzkzMjNmMGEzODVmNDI0M2RAMTI3LjAuMC4xOjk4MzYmd2Vic29ja2V0X3By%0Ab3h5PXdzOi8vMTI3LjAuMC4xOjk4MzYmcnVuZT1zSnhsMzdqX1hkOXBPS3RJbC1CSVhOMkpZWUxq%0AWTFWRUVINGJVYXRUWG5rOU16Yz0%3D
p2p_link: http://127.0.0.1/P3R5cGU9cDJwJnVyaT0wM2NjOGMwYjI0MmUyY2U4NTc5MTM4YmYyYzM0YzgyMzg0NzU5NDZiMTQ3%0AZGMxODBlMzkzMjNmMGEzODVmNDI0M2RAMTI3LjAuMC4xOjk3MzYmcnVuZT1zSnhsMzdqX1hkOXBP%0AS3RJbC1CSVhOMkpZWUxqWTFWRUVINGJVYXRUWG5rOU16Yz0%3D
websocket_link: http://127.0.0.1/P3R5cGU9d2Vic29ja2V0JnVyaT0wM2NjOGMwYjI0MmUyY2U4NTc5MTM4YmYyYzM0YzgyMzg0NzU5%0ANDZiMTQ3ZGMxODBlMzkzMjNmMGEzODVmNDI0M2RAMTI3LjAuMC4xOjk4MzYmd2Vic29ja2V0X3By%0Ab3h5PXdzOi8vMTI3LjAuMC4xOjk4MzYmcnVuZT1zSnhsMzdqX1hkOXBPS3RJbC1CSVhOMkpZWUxq%0AWTFWRUVINGJVYXRUWG5rOU16Yz0%3D
Then the clams/prism app, etc, an parse the BASE64 and URL_ENCODED query strings and populate the connection info for the respective app.
Here's an idea to consider for the future. Perhaps we could encrypt the query string values under a nostr pubkey, then publish a note to a set of known nostr relays. Each browser app would have to implement nostr-based login e.g., nos2x to use this functionality, but it could mean that once a node is deployed, a user's connection string parameters can be securely stored and accessed from a censorship-resistant distributed data store.
If the browser app could accept the Node URI components as query string parameters, it would be possible to skip an entire step of the onboarding process (i.e., the Connect page on the
/connect
route). (Assuming you have this information ahead of time)Something like:
https://clams.domain.tld/connect?type=direct-ws&pubkey=<NODE_PUBKEY&host=&port=7272
Type could indicate connection type, e.g., direct-ws for "Direct Connect to a ws:// endpoint".