-
Notifications
You must be signed in to change notification settings - Fork 4
Allow for custom HTTPHrnResolvers #7
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
base: main
Are you sure you want to change the base?
Conversation
We probably don't want someone to be able to configure a full client including headers, right? We just care about proxying, AFAIU. |
I don't really see the downside. Being able to provide the full client is nice because then you can reuse the client across uses. |
Looking at the current source for |
FWIW, most of the crates in the space (e.g., |
Hmm, though in those cases its probably okay to have things like cookies coped over? You might set an auth cookie once and use it both for esplora and other APIs to the same host. Whereas in this case, any difference in requests across clients is pretty bad (not that we can avoid it too well...HTTP sucks) |
47d15b8
to
7237ce0
Compare
This allows for giving a custom reqwest client when creating a HTTPHrnResolver. This is useful for adding custom headers, proxying connections, etc. This also has the added benefit of using the same reqwest client across every call so it'll be better and reusing tls connections.
Did we ever resolve this discussion? |
I tried to see if we could turn the from_client function into a Result type and we could do some validation on if they're doing any of the foot guns but doesn't seem like they expose the config after the client is built. I still stand by the current changes. I think this api is by far the simplest and most convenient for the user. There are small privacy tradeoffs but lnurl isn't really meant to be a private protocol and often is used for the opposite (zaps) |
Closes #3
This allows for giving a custom reqwest client when creating a HTTPHrnResolver. This is useful for adding custom headers, proxying connections, etc. This also has the added benefit of using the same reqwest client across every call so it'll be better and reusing tls connections.