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

Move most of gvproxy code to a reusable go package with an API #286

Open
cfergeau opened this issue Oct 18, 2023 · 2 comments
Open

Move most of gvproxy code to a reusable go package with an API #286

cfergeau opened this issue Oct 18, 2023 · 2 comments

Comments

@cfergeau
Copy link
Collaborator

gvproxy code:

  1. register/parses command line arguments
  2. creates a types.Configuration instance from these args
  3. creates some listeners/http muxers from these args + associated go routines

All of this is done in 2 big functions.
The crc daemon does 2) and 3) but with slight variations, and without sharing any code from gvproxy.
Following #280 , it might be useful to podman as well to have an easy way to reimplement their own gvproxy + 9p binary.

What I aim to do is to move 2) and 3) to their own go package (maybe pkg/usernet) which can be used by both gvproxy and the crc daemon. Adding an API for 2) is mostly done, 3) is still being investigated.

@cfergeau
Copy link
Collaborator Author

Future improvements could be to move the code in podman detecting whether port 2222 is used or not, and using a different one to this shared code (see containers/podman#20327 and crc-org/crc#3855 )

@cfergeau
Copy link
Collaborator Author

cfergeau commented Jun 4, 2024

Did some work on this in https://github.com/cfergeau/gvisor-tap-vsock/tree/refactor, which adds an api for "2. creates a types.Configuration instance from these args". This needs to be rebased though.

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

1 participant