This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
Simple tcp to socket multiplexing reverse proxy #438
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a simple mux reverse proxy that can listen on a tcp port and multiplexes requests to the plugins that it is able to communicate with.
For each HTTP request, the mux proxy will look at the URL of the request. The URL of the form
It will locate the plugin
plugin_name
and forward the request with theplugin_name
stripped. This makes it possible for the user to start a server to act as an API gateway so that a remote CLI orr web application / dashboard UI can access the infrakit plugin API.Over time, we will add auth and forwarding (to master) to this mux frontend so that it becomes a single point of contact for accessing infrakit SPI remotely. We may choose to limit the JSON RPC methods that are exposed by filtering the requests.
Now the
infrakit
CLI also supports accessing remote infrakit plugins via the-H
options similar todocker -H <host>
. You can add multiple proxy endpoints in the case of HA setup and the infrakit CLI will automatically determine the leader node and uses the mux proxy on the leader for all communications. This behavior is dynamic, so as long as the original set of host endpoint provided does not change (ie stable IP addresses and ports for members of an infrakit HA setup), the remote infrakit cli will follow the leader as leadership changes due to failover, etc.Signed-off-by: David Chung david.chung@docker.com