Skip to content

Commit

Permalink
Fix argument order
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Nov 12, 2019
1 parent b6f9d62 commit a6324ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/apps/therealproxy-client/therealproxy-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func main() {
clientTimeout = defaultTimeout
}

client, err := therealproxy.NewClient(clientTimeout, l, socksApp, remote)
client, err := therealproxy.NewClient(l, socksApp, remote, clientTimeout)
if err != nil {
log.Fatal("Failed to create a new client: ", err)
}
Expand Down
8 changes: 4 additions & 4 deletions internal/therealproxy/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ var Log = logging.MustGetLogger("therealproxy")

// Client implement multiplexing proxy client using yamux.
type Client struct {
timeout time.Duration
session *yamux.Session
listener net.Listener
app *app.App
addr routing.Addr
timeout time.Duration
session *yamux.Session
}

// NewClient constructs a new Client.
func NewClient(timeout time.Duration, lis net.Listener, app *app.App, addr routing.Addr) (*Client, error) {
func NewClient(lis net.Listener, app *app.App, addr routing.Addr, timeout time.Duration) (*Client, error) {
c := &Client{
timeout: timeout,
listener: lis,
app: app,
addr: addr,
timeout: timeout,
}
if err := c.connect(); err != nil {
return nil, err
Expand Down

0 comments on commit a6324ae

Please sign in to comment.