outline-ss-server icon indicating copy to clipboard operation
outline-ss-server copied to clipboard

Add command line client with SOCKS

Open ha-D opened this issue 3 years ago • 2 comments

Adds a command line client for the outline-ss-server. This should help with easier prototyping of features without having to go through the whole stack.

It starts a SOCKS server, accepts TCP connections and proxies them to the configured outline server. Non-goals for this PR (can be added later):

  • UDP
  • Automatically setting the system proxy

--

Two decisions I made which are worth discussing:

  • Should it have a separate main or should we implement it as part of the same (server) binary and distinguish between running the server and client using a flag (similar to what go-shadowsocks2 does). I prefer separate myself and thats what I went with (though maybe we want to restructure packages a bit), let me know if you think it's better to go with a single binary.

  • How should the client take in the server configurations (e.g, host, port, password)

    • Using separate flags go run cmd/client -p port -s server -m cipher -k password
    • Using configuration file go run cmd/client -c config.yaml This will have to be a different config format that the one used for the server since the client can't take multiple keys
    • Using a single flag to pass in key url go run cmd/client -k ss://[email protected]:8080 This is the one I'm going with right now. I'm not sure if the way I parse the key is fully compilable with SIP002 but I think its compilable enough (?).

ha-D avatar Oct 30 '22 21:10 ha-D

Thanks for the quick reviews!!

ha-D avatar Oct 31 '22 15:10 ha-D

@ha-D I found https://github.com/things-go/go-socks5. It seems it's a lot easier to use that library, and it supports UDP too. I think all you need to do is call NewServer with https://pkg.go.dev/github.com/things-go/go-socks5#WithDial, taking a wrapped Shadowsocks client as the Dialer.

fortuna avatar Dec 06 '22 04:12 fortuna