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

Support SOCKS over Unix domain sockets #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JeremyRand
Copy link
Contributor

Fixes #39 ; tested with a lightly patched spesmilo/electrumx on Whonix 15 and seems to work fine with the SOCKS Unix socket that Whonix provides.

Let me know if anything needs improvement, or if you need tests added.

@JeremyRand
Copy link
Contributor Author

The Coveralls fails on Azure appear to not be directly related to this PR.

Copy link
Owner

@kyuupichan kyuupichan left a comment

Choose a reason for hiding this comment

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

I've recreated the Coveralls token; hopefully that issue goes away

aiorpcx/util.py Outdated

def __eq__(self, other):
# pylint: disable=protected-access
return self._path == other._path
Copy link
Owner

Choose a reason for hiding this comment

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

This needs to test isinstance before testing the member

aiorpcx/socks.py Outdated

auth is an authentication method to use when connecting, or None.
'''
if not isinstance(address, NetAddress):
if not isinstance(address, NetAddress) and not isinstance(address, UnixAddress):
Copy link
Owner

Choose a reason for hiding this comment

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

Please combine these. isinstance takes a tuple to test multiple cases.

@JeremyRand
Copy link
Contributor Author

Addressed feedback, thanks for catching those. Coveralls still unhappy as before due to a missing token. I'm pretty sure the Py38_Win pytest failure is unrelated to this PR as well (it seems to be in a completely unrelated area of the code).

@kyuupichan
Copy link
Owner

Hi Jeremy, the issue with the missing var seems to be fixed (I renamed it; unclear what the problem was as it used to work and I didn't change anything). So coveralls now runs. Can you please provide 100% test coverage of the new lines of code.

@JeremyRand
Copy link
Contributor Author

@kyuupichan What's the preferred way to test the Unix socket code? Tweak FakeServer to handle Unix sockets? Run an actual SOCKS proxy (e.g. Tor) on a Unix socket and connect to that? Something else?

@kyuupichan
Copy link
Owner

Whatever is simplest for you. I don't think you need all the tests that already exist as the socks code is network-independent. I'm mainly interested in code coverage. So a single test that tests a successful connection is made would suffice - the assumption being if it works for a successful connection then all the other cases have no reason not work too. You might need to add a dummy test for one or two of the methods of the class you add, or they might all get used anyway; I'm not sure.

@JeremyRand
Copy link
Contributor Author

Coveralls on Azure still seems unhappy about a missing token. :/

@kyuupichan
Copy link
Owner

git HEAD is not - as you can see from recent changes I've made - are you building on HEAD?

@JeremyRand
Copy link
Contributor Author

git HEAD is not - as you can see from recent changes I've made - are you building on HEAD?

I think so? This PR's parent commit is d3f5ac5. That should have the fix, right?

@kyuupichan
Copy link
Owner

It makes no sense to me - when you run it, azure pipelines doesn't replace $(CRT) with the variable's value; when I run it, it does. I suggest you just add the tests that pass for you and that you think give coverage, and I just merge it.

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.

SOCKS over Unix sockets
2 participants