go-shadowsocks2 icon indicating copy to clipboard operation
go-shadowsocks2 copied to clipboard

Add dialer interface according to golang.org/x/net/proxy.

Open jackyyf opened this issue 7 years ago • 6 comments

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.

jackyyf avatar Apr 29 '17 10:04 jackyyf

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?

riobard avatar May 06 '17 09:05 riobard

You are right, it could be moved to another separate package, I'll refactor my code, thanks for pointing that out :)

jackyyf avatar May 06 '17 16:05 jackyyf

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.

riobard avatar May 06 '17 16:05 riobard

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.

jackyyf avatar May 08 '17 07:05 jackyyf

The code looks pretty good now. What do you think if you make it available as its own repo on GitHub?

riobard avatar Jun 18 '17 04:06 riobard

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 :)

jackyyf avatar Jul 17 '17 16:07 jackyyf