Skip to content
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

rpc: use SOCKS5 proxy if configured #1294

Merged
merged 2 commits into from Dec 3, 2018
Merged

rpc: use SOCKS5 proxy if configured #1294

merged 2 commits into from Dec 3, 2018

Conversation

aerth
Copy link
Contributor

@aerth aerth commented Sep 28, 2018

There are config options and flags that currently exist for using SOCKS proxy, but don't do anything.
This exports NewRPCClientConfig, which creates an RPC Client to the chain package and uses it in dcrwallet command.

  • NewRPCClientConfig accepts a dcrrpcclient.ConnConfig for even more precise configuration

Resolves #1287

chain/chain.go Outdated Show resolved Hide resolved
netparams/params.go Outdated Show resolved Hide resolved
chain/chain.go Outdated
// operate on the same decred network as described by the passed chain
// parameters, the connection will be disconnected. If proxypath is not empty,
// it will be used to connect.
func NewClient(chainParams *chaincfg.Params, connect, user, pass string, certs []byte,
Copy link
Member

Choose a reason for hiding this comment

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

If NewClientConfig is exported, I don't see any reason to also include this.

Copy link
Contributor Author

@aerth aerth Oct 8, 2018

Choose a reason for hiding this comment

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

One reason is that any caller of NewRPCClientConfig will need to import dcrrpcclient package, and any user of NewRPCClient can simply update to using NewClient (with SOCKS support) without changing too much code.

Copy link
Member

Choose a reason for hiding this comment

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

It's a transient dependency anyways, making it an explicit import doesn't change anything and adds less cruft to the public API.

chain/chain.go Outdated

// NewClientConfig creates a client connection to the server described by the
// passed chainParams and connConfig
func NewClientConfig(chainParams *chaincfg.Params, connConfig *dcrrpcclient.ConnConfig) (*RPCClient, error) {
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: can you rename this to NewRPCClientConfig for more similarity with the existing NewRPCClient?

@jrick jrick merged commit 672b8e5 into decred:master Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants