go-shadowsocks2
go-shadowsocks2 copied to clipboard
Add dialer interface according to golang.org/x/net/proxy.
This allow us to use shadowsocks as upstream proxy in go program more easily, and a (like-to-be) standard interface would be nice.
I've attached some testcases with pull request, and all tests passed with forked version.
I actually regret to have the core
providing the helper functions since they assume too much of the use case. I was hoping the repo stays barely minimal so others could easily embed it into their own projects. Do you think the dialer is absolutely necessary given the minimalism philosophy?
You are right, it could be moved to another separate package, I'll refactor my code, thanks for pointing that out :)
I think your code could be organized into a standalone package providing proxy support via e.g. Shadowsocks, SOCKS5, HTTP proxy, etc. That will be more compatible with the design of golang.org/x/net/proxy
. Let me know if there's anything I can do to help.
Also, I'm thinking about separating the reusable packages and the demo server/client to use them.
I've moved dialer interface to a separate package named proxy. I don't know if this is ok, and please comment for change if this name is too generic or too ambiguous.
The code looks pretty good now. What do you think if you make it available as its own repo on GitHub?
Sorry for the looooong delay, I had some serious about my graduation design and it took whole June to get around with it, and I just have spare time now to reply this issue.
Making as own repo is fine, but I would recommend to include this within primary repo, or at least as a project under shadowsocks organization to make this interface used by more people. Anyway, thanks for the review :)