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

Code improvement #16

Closed
4 of 5 tasks
pufferffish opened this issue Mar 28, 2022 · 2 comments
Closed
4 of 5 tasks

Code improvement #16

pufferffish opened this issue Mar 28, 2022 · 2 comments
Assignees

Comments

@pufferffish
Copy link
Owner

pufferffish commented Mar 28, 2022

  • Use an existing config format instead of rolling a custom one (e.g. INI).

  • Implement reading from standard wireguard configuation

  • Instead of passing around a config map[string]string everywhere, parse the config once, at the top of main, and then pass properly-typed arguments to the functions that need them. For example, tcpServerRoutine should just take an int.

  • Listen for Ctrl-C at the end of main so you can shutdown gracefully. (unnecessary, sockets are closed automatically upon shutdown, and wireguard peers do not need to be notified of shutdowns)

  • Use io.Copy (or io.CopyBuffer) to simplify connForward

@pufferffish pufferffish self-assigned this Mar 28, 2022
@PAI5REECHO
Copy link

Maybe make it semi-compatible with wireguard configuation

Came here to an open issue for that specifically. SelfSecretKey, SelfSecretKey, SelfEndpoint, PeerPublicKey, PeerEndpoint & DNS can just be directly read from the PrivateKey, Address, DNS, PublicKey, AllowedIPs & Endpoint of a wg-quick config file directly. Being able to supply the config using 1 config key like WGConfig = .../some/path/wg_quick.conf and/or -wg-config .../some/path/wg_quick.conf as command-line argument would be ideal

@fscarmen
Copy link
Contributor

Maybe make it semi-compatible with wireguard configuation

Came here to an open issue for that specifically. SelfSecretKey, SelfSecretKey, SelfEndpoint, PeerPublicKey, PeerEndpoint & DNS can just be directly read from the PrivateKey, Address, DNS, PublicKey, AllowedIPs & Endpoint of a wg-quick config file directly. Being able to supply the config using 1 config key like WGConfig = .../some/path/wg_quick.conf and/or -wg-config .../some/path/wg_quick.conf as command-line argument would be ideal

It 's very helpful to read the values from the wgcf config file.

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

3 participants