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

Ability to set custom headers in HTTP requests #304

Open
tomjohnburton opened this issue Jun 8, 2023 · 1 comment
Open

Ability to set custom headers in HTTP requests #304

tomjohnburton opened this issue Jun 8, 2023 · 1 comment

Comments

@tomjohnburton
Copy link

Hello,

I am using the rust-bitcoincore-rpc library in a project where I run a Bitcoin node behind a Traefik reverse proxy for testing purposes. I use the hostname bitcoin.localhost to access the Bitcoin node.

I'm facing an issue when I use this library to send requests to my Bitcoin node. Even though I've mapped bitcoin.localhost to localhost in my /etc/hosts file, it seems that the requests from this library are not being correctly routed to the Bitcoin node by Traefik.

Looking at Traefik's logs, it appears that the HTTP requests sent from this library don't have the Host header set to bitcoin.localhost, which is causing Traefik to not route the requests to the Bitcoin node.

I've tried to set the Host header manually in the library, but it seems that this functionality is not currently supported.

Having the ability to set custom headers in HTTP requests would be very useful in my case, and I think it would also be a good feature to have in the library in general.

Could you please consider adding this functionality, or suggest another workaround to handle my situation?

Thank you for your help and for maintaining this library.

@apoelstra
Copy link
Member

apoelstra commented Jun 8, 2023

I think this properly belongs in rust-jsonrpc, which handles the HTTP transport -- this was recently updated to allow using minreq rather than our own homebrew HTTP server. I think that might cover your use case.

rust-jsonrpc is at https://github.com/apoelstra/rust-jsonrpc/

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

No branches or pull requests

2 participants