-
Notifications
You must be signed in to change notification settings - Fork 189
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
Add command line client with SOCKS #130
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
cmd/client/client.go
Outdated
host string | ||
port int | ||
cipher string | ||
secret string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be []bytes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to have to string it again when passing to client.NewClient
. Do you think I should still keep it []byte here?
cmd/client/client.go
Outdated
return s.listener.Close() | ||
} | ||
|
||
func main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you create a README.md file explaining how to run the socks proxy? Mention it only supports TCP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you rather have a separate README in cmd/client
or do you think I should update the original README to change the go-shadowsocks2
client to this one?
Thanks for the quick reviews!! |
@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. |
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):
--
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)
go run cmd/client -p port -s server -m cipher -k password
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
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 (?).