-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Porting ss-redir to go
#473
base: master
Are you sure you want to change the base?
Conversation
| "time" | ||
|
|
||
| ss "github.com/shadowsocks/shadowsocks-go/shadowsocks" | ||
| ss "github.com/bonafideyan/shadowsocks-go/shadowsocks" |
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.
pls fix the dependency
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.
Done.
cmd/shadowsocks-local/guess.go
Outdated
| @@ -0,0 +1,138 @@ | |||
| package 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.
this file should be in shadowsocks package but not the client main package
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.
Done.
cmd/shadowsocks-httpget/httpget.go
Outdated
| } | ||
| } | ||
|
|
||
| func dialSocks5(targetAddr, proxy string) (conn net.Conn, err error) { |
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 be added into shadowsocks package
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.
Done.
arthurkiller
left a comment
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.
Thx for your contribution.
Have you got and Document about this PR? Pls put it up here or another issue.
|
Add command line parameter
and set iptables rules, refererence here. |
| "strings" | ||
| "time" | ||
|
|
||
| ss "github.com/bonafideyan/shadowsocks-go/shadowsocks" |
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.
fix your dependency.
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.
your can add your branch as a reference for git
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.
Sorry, I don't know how to do it, could you please give me some steps in detail?
arthurkiller
left a comment
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.
request changes
| func main() { | ||
| flag.StringVar(&config.server, "s", "127.0.0.1", "server:port") | ||
| flag.IntVar(&config.port, "p", 0, "server:port") | ||
| server := flag.String("s", "127.0.0.1", "server:port") |
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.
keey the code style
|
|
||
| if config.server == "" || config.port == 0 || config.passwd == "" || len(flag.Args()) != 1 { | ||
| fmt.Printf("Usage: %s -s <server> -p <port> -k <password> <url>\n", os.Args[0]) | ||
| config.server = "127.0.0.1" |
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.
default config can be set with flag
| } | ||
|
|
||
| func handleConnection(conn net.Conn) { | ||
| func handleConnection(conn net.Conn, redir bool) { |
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.
need a new function called redirectConnection
| var redirect bool | ||
|
|
||
| flag.BoolVar(&printVer, "version", false, "print version") | ||
| flag.BoolVar(&redirect, "redirect", false, "Redirect normal request to socks server.") |
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.
same
| } | ||
|
|
||
| // DialAsClient dials in client's position. | ||
| func DialAsClient(server, proxy string) (conn net.Conn, err error) { |
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.
add unit test for this function
Only socks proxy is a bit inconvenient, so ...