This should have the command behave the same, except you now need to run it like: go run cmd/tcp-proxy/main.go. But now you can also import and use this as a package, with all the stuff that are cmdline args in the program as parameters and settings on an instance of a Proxy struct (with sane defaults). Otherwise the behavior (and the meat of the code) is unchanged.
This should have the command behave the same, except you now need to run it like:
go run cmd/tcp-proxy/main.go
. But now you can also import and use this as a package, with all the stuff that are cmdline args in the program as parameters and settings on an instance of aProxy
struct (with sane defaults). Otherwise the behavior (and the meat of the code) is unchanged.Changes: