Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Conversation

bonafideyan
Copy link

Only socks proxy is a bit inconvenient, so ...

"time"

ss "github.com/shadowsocks/shadowsocks-go/shadowsocks"
ss "github.com/bonafideyan/shadowsocks-go/shadowsocks"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls fix the dependency

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -0,0 +1,138 @@
package main
Copy link
Collaborator

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

}
}

func dialSocks5(targetAddr, proxy string) (conn net.Conn, err error) {
Copy link
Collaborator

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

@arthurkiller arthurkiller left a 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.

@bonafideyan
Copy link
Author

Add command line parameter

-redirect,

and set iptables rules, refererence here.

"strings"
"time"

ss "github.com/bonafideyan/shadowsocks-go/shadowsocks"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix your dependency.

Copy link
Collaborator

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

Copy link
Author

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?

Copy link
Collaborator

@arthurkiller arthurkiller left a 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")
Copy link
Collaborator

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"
Copy link
Collaborator

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) {
Copy link
Collaborator

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.")
Copy link
Collaborator

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) {
Copy link
Collaborator

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants