Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move LND node communication to background script #244

Merged
merged 3 commits into from
Feb 29, 2020

Conversation

wbobeirne
Copy link
Member

Indirect progress towards #46, #42, #78. Should unblock #222.

Description

This refactors the lib/lnd-http library to have two API-compatible implementations

  1. The good ol' LndHttpClient is now run in the background script
  2. All other contexts (popup, options, content script) will now use an LndMessageClient, that has an identical API, but just sends messages to the background script to send.

This is an extremely ugly layer of abstraction, not to mention the code is nearly sinful to avoid too much code duplication, but it comes with some major benefits:

  • HTTP requests are now happening in their own thread, which should avoid most common tactics for trying to snoop on requests and responses
  • LND interactions in the content script are no longer subject to the limitations of doing things in the content context (CORS errors, CSPs of the page you're on etc.)

Steps to Test

Really the whole app, unfortunately

@wbobeirne wbobeirne merged commit 85bac5c into develop Feb 29, 2020
@wbobeirne wbobeirne deleted the lnd-background-script branch February 29, 2020 04:05
wbobeirne added a commit that referenced this pull request Dec 16, 2021
@wbobeirne wbobeirne mentioned this pull request Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant