Skip to content

Commit

Permalink
Upgrade sdk version and add dial timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <zyl.skysniper@gmail.com>
  • Loading branch information
yilunzhang committed Feb 25, 2022
1 parent 26f6a25 commit 699207e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type Config struct {
Cipher string `json:"cipher,omitempty" long:"cipher" description:"Socks proxy cipher. Dummy (no cipher) will not reduce security because NKN tunnel already has end to end encryption." choice:"dummy" choice:"chacha20-ietf-poly1305" choice:"aes-128-gcm" choice:"aes-256-gcm" default:"chacha20-ietf-poly1305"`
Password string `json:"password,omitempty" long:"password" description:"Socks proxy password"`

DialTimeout int32 `json:"dialTimeout,omitempty" long:"dial-timeout" description:"dial timeout in milliseconds"`
SessionWindowSize int32 `json:"sessionWindowSize,omitempty" long:"session-window-size" description:"tuna session window size (byte)."`

LogFileName string `json:"log,omitempty" long:"log" description:"Log file path. Will write log to stdout if not provided."`
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ require (
github.com/jessevdk/go-flags v1.4.0
github.com/nknorg/ncp-go v1.0.4-0.20220224111535-206abfb10fe8
github.com/nknorg/nkn-sdk-go v1.3.8
github.com/nknorg/nkn-tuna-session v0.2.1
github.com/nknorg/nkn-tunnel v0.3.1
github.com/nknorg/nkn-tuna-session v0.2.2
github.com/nknorg/nkn-tunnel v0.3.2
github.com/nknorg/nkn/v2 v2.1.8
github.com/nknorg/nkngomobile v0.0.0-20220125080321-848ddd2e5157
github.com/nknorg/tuna v0.0.0-20220224114148-597496bdcb11
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ github.com/nknorg/ncp-go v1.0.4-0.20220224111535-206abfb10fe8/go.mod h1:ALtnk9lK
github.com/nknorg/nkn-sdk-go v1.3.7/go.mod h1:JSksFP+VQ0S54Ztiht6WHC3tNZklcGg+JaxENuFnqRc=
github.com/nknorg/nkn-sdk-go v1.3.8 h1:t4lcHYcEC3ylWDgbObbw2zXBuEVgcMIC3jAOKGgRzmg=
github.com/nknorg/nkn-sdk-go v1.3.8/go.mod h1:/2FtpRM4mWpze03V8FIoESQCa6wCdPRPQO9HqpIMNYw=
github.com/nknorg/nkn-tuna-session v0.2.1 h1:+xETWix5dmplLQqFgBwGVNJs5nAhjCZU5sPP4ll/GxI=
github.com/nknorg/nkn-tuna-session v0.2.1/go.mod h1:k+i+HePAOswU74klYpUawqOBKnTqvB9BfUzFTFaggMU=
github.com/nknorg/nkn-tunnel v0.3.1 h1:/r4FFw4BHQW7BnRNBZmuyokvhtuuVpsi/Nar6Cr4kos=
github.com/nknorg/nkn-tunnel v0.3.1/go.mod h1:VZi3YTp6iJM7lVlIhT+KLCw6PnfEPav5J51iDz4Ly/A=
github.com/nknorg/nkn-tuna-session v0.2.2 h1:3RF0Me8orGt+ZKr00iPPZb/iagKBB0mlbjCuu9xFJBs=
github.com/nknorg/nkn-tuna-session v0.2.2/go.mod h1:k+i+HePAOswU74klYpUawqOBKnTqvB9BfUzFTFaggMU=
github.com/nknorg/nkn-tunnel v0.3.2 h1:UU0hpuU/qHEklQVcu1WpYBL+6kv3GWI6Uoz2+/0eoJc=
github.com/nknorg/nkn-tunnel v0.3.2/go.mod h1:mU030RAQEFx6Q3mmfxyOiEfZDI5cNiMAlIsJjfEDUJI=
github.com/nknorg/nkn/v2 v2.0.6/go.mod h1:cXl2WTv72trEXKJiNH0dCMygMtL8nJne07dWajDlRIo=
github.com/nknorg/nkn/v2 v2.1.7/go.mod h1:4xzrHJCI/FDFZmlt606Mn9ScKY4UUCFoaWydL1TzQRs=
github.com/nknorg/nkn/v2 v2.1.8 h1:h25rqQ0E8CvlN8Jm4zF6CBBLgwdoSS7HHdrU4ZYcmjA=
Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ func main() {
walletConfig := &nkn.WalletConfig{
SeedRPCServerAddr: seedRPCServerAddr,
}
dialConfig := &nkn.DialConfig{
DialTimeout: opts.DialTimeout,
}

if isValidUrl(opts.TunaMaxPrice) {
price, err := getRemotePrice(opts.TunaMaxPrice)
Expand Down Expand Up @@ -241,6 +244,7 @@ func main() {
AcceptAddrs: nkn.NewStringArray(persistConf.AcceptAddrs...),
ClientConfig: clientConfig,
WalletConfig: walletConfig,
DialConfig: dialConfig,
TunaSessionConfig: tsConfig,
Verbose: opts.Verbose,
}
Expand Down

0 comments on commit 699207e

Please sign in to comment.