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
rpcserver: forward gRPC proxy requests to localhost when listening on all interfaces #2247
rpcserver: forward gRPC proxy requests to localhost when listening on all interfaces #2247
Conversation
318ebf2
to
72b2f4e
Compare
@wpaulino Just wanted to drop a note that I've patched my |
I don't understand, this PR seems to transform 0.0.0.0 to 127.0.0.1, this is not what I want. |
@NicolasDorier It does this internally so the REST-to-gRPC proxy goes to the same host where LND is running (and since it's the same single binary, i.e. proxy and gRPC can't be on different hosts, it always works with 127.0.0.1). It doesn't bind REST endpoint to loopback. So it will fix the issue you were facing. |
Oh I get it! thanks a lot, will test. |
I also ran into the "authentication handshake failed" error on my remote node, trying to setup the joule extension. I manually patched |
72b2f4e
to
3f538cb
Compare
This issue also showed up in related PR #2428. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :D
@@ -533,9 +533,17 @@ func (r *rpcServer) Start() error { | |||
// TODO(roasbeef): eventually also allow the sub-servers to themselves | |||
// have a REST proxy. | |||
mux := proxy.NewServeMux() | |||
grpcEndpoint := cfg.RPCListeners[0].String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a comment why this string replacing is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
… all interfaces This prevents certificate issues when accessing the gRPC REST proxy externally.
3f538cb
to
552b71c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🦁
This prevents certificate issues when accessing the gRPC REST proxy externally.
Fixes #1567.