8000 Fixes #99 by adding --resolve argument support · Pull Request #657 · httpie/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixes #99 by adding --resolve argument support #657

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

Closed
wants to merge 1 commit into from
Closed

Fixes #99 by adding --resolve argument support #657

wants to merge 1 commit into from

Conversation

ghost
Copy link
@ghost ghost commented Feb 28, 2018

Hi! I've tried to add --resolve argument with a support for both IPv4 and IPv6. I would appreciate any comments:)

@fearphage
Copy link

Fixes #99 (just added for the dynamic linking effect)

Copy link
@aztlan2k aztlan2k left a comment

Choose a reason for hiding this comment

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

Does it work? I tried to test it from your branch but couldn't get it to work for me, it would just hang.

"""
self.entries = {}
for entry in resolve:
host, port, addresses = entry.split(':', 2)

Choose a reason for hiding this comment

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

it seems that this won't work correctly if you specify an address without a port. (e.g. www.foo.com:127.0.01) Since this address will end up as the port in this case.

def test_resolve_ipv4(self):
with MockHTTPServer(4) as mock_http_server:
r = http('http://httpbin.org:%s/' % mock_http_server.port,
'--resolve', 'httpbin.org:%s:%s' % (mock_http_server.port, mock_http_server.host))

Choose a reason for hiding this comment

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

as far as I can tell you never test not specifying a PORT when calling --resolve. (--resolve www.foo.com:127.0.0.1)

@aztlan2k
Copy link

wait a minute... this change is based on a really old version of httpie (c. 2012 - pre-v0.2.6) current master __main__.py looks nothing like that.

@ghost
Copy link
Author
ghost commented Mar 1, 2018 via email

@ghost ghost closed this Mar 1, 2018
This pull request was closed.
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.

2 participants
0