multi: add flag to enable REST calls on main listener(s)

Fixes #213 by allowing users to enable REST calls to be made directly to
the main HTTP(S) listener(s). This approach is chosen over spinning up
an additional listener (or multiple, if non-TLS is also needed) just for
REST because it should make everyone's lives easier if only one port
needs to be used. There also shouldn't be any security tradeoff since a
macaroon is still required and all communication happens over TLS
anyway.
This commit is contained in:
Oliver Gugger 2021-04-27 14:59:21 +02:00
parent 48d7b9bebb
commit 0159e0a6a9
No known key found for this signature in database
GPG key ID: 8E4256593F177720
3 changed files with 160 additions and 14 deletions

View file

@ -87,7 +87,7 @@ func newRpcProxy(cfg *Config, validator macaroons.MacaroonValidator,
// it is handled there. If not, the director will forward the call to either a
// local or remote lnd instance.
//
// any RPC or REST call
// any RPC or grpc-web call
// |
// V
// +---+----------------------+
@ -246,8 +246,6 @@ func (p *rpcProxy) isHandling(resp http.ResponseWriter,
return true
}
// TODO(guggero): Handle REST calls as well.
return false
}