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

Fix proxy support #871

Merged
merged 2 commits into from
Feb 18, 2020
Merged

Fix proxy support #871

merged 2 commits into from
Feb 18, 2020

Conversation

braydonf
Copy link
Contributor

@braydonf braydonf added the waiting for dependency Waiting for a dependency update. label Oct 10, 2019
@codecov-io

This comment has been minimized.

@pinheadmz
Copy link
Member

Tested with and without the bsocks patch braydonf/bsocks@40fa1f1.

Got the same error without:
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 6. Received 8

No issues with the patch, tested by proxy-ing through tor:

bcoin --prefix=/Volumes/Serenity/proxy_test_10-10-19 --proxy=:<pw>@127.0.0.1:9150 --onion

As a side note, I wonder if proxy info should be reported in the RPC:

$  bcoin-cli rpc getnetworkinfo
{
  "version": "2.0.0-dev",
  "subversion": "/bcoin:2.0.0-dev/",
  "protocolversion": 70015,
  "localservices": "00000009",
  "localservicenames": [
    "NETWORK",
    "WITNESS"
  ],
  "localrelay": true,
  "timeoffset": -1,
  "networkactive": true,
  "connections": 7,
  "networks": [],
  "relayfee": 0.00001,
  "incrementalfee": 0,
  "localaddresses": [],
  "warnings": ""
}

@braydonf
Copy link
Contributor Author

@pinheadmz Note: --proxy and --onion currently do not work together. That will need to be another fix.

@pinheadmz
Copy link
Member

I noticed that - all peers were clearnet addresses, but traffic was still routing through the tor proxy.

@braydonf
Copy link
Contributor Author

braydonf commented Oct 10, 2019

Yeah, technically with --proxy can have .onion hosts. However, the current addr format only supports the shorter v2 .onion hosts, there is a BIP proposal for addrv2. There would need to be an option to limit to only .onion for outgoing to achieve that, and then seed with some .onion hosts and then receive new addr messages for other hosts. The --onion option should enable incoming connections via an .onion address; however will need to listen on a different port than used for outgoing for the proxy.

@pinheadmz
Copy link
Member

Ah, gotcha. I also tried adding onion peers (from bitcoind's seed list) and was able to connect:

bcoin-cli rpc addnode 2bfsxzluysybysnr.onion:8333 add

@braydonf braydonf added this to the 2.0.0 milestone Jan 6, 2020
@braydonf braydonf removed the waiting for dependency Waiting for a dependency update. label Feb 18, 2020
braydonf added a commit that referenced this pull request Feb 18, 2020
@braydonf braydonf merged commit 0ff6b98 into bcoin-org:master Feb 18, 2020
@braydonf braydonf deleted the update-bsocks branch February 18, 2020 20:25
@Trimninja47
Copy link

This is really as close as I've been having a solution. But I still can't implement the process the right way. Is there anyone that can help me through this?

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.

Failed to use TOR-proxy
4 participants