Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ipv6 support for proxy#7090

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
vasiliyk wants to merge9 commits intoscrapy:master
base:master
Choose a base branch
Loading
fromvasiliyk:ipv6_proxy_support

Conversation

@vasiliyk
Copy link
Contributor

@vasiliykvasiliyk commentedOct 12, 2025
edited
Loading

PRcloses#6674

@codecov
Copy link

codecovbot commentedOct 13, 2025
edited
Loading

Codecov Report

❌ Patch coverage is95.31250% with3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.44%. Comparing base (b49aa2f) to head (42f40fa).
⚠️ Report is 11 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
scrapy/core/downloader/handlers/http11.py95.31%1 Missing and 2 partials⚠️
Additional details and impacted files
@@            Coverage Diff             @@##           master    #7090      +/-   ##==========================================+ Coverage   91.10%   91.44%   +0.34%==========================================  Files         165      165                Lines       12836    12694     -142       Branches     1661     1626      -35     ==========================================- Hits        11694    11608      -86+ Misses        859      811      -48+ Partials      283      275       -8
Files with missing linesCoverage Δ
scrapy/core/downloader/handlers/http11.py93.75% <95.31%> (+0.03%)⬆️

... and26 files with indirect coverage changes

Signed-off-by: Vasiliy Kiryanov <1378948+vasiliyk@users.noreply.github.com>
Signed-off-by: Vasiliy Kiryanov <1378948+vasiliyk@users.noreply.github.com>
Signed-off-by: Vasiliy Kiryanov <1378948+vasiliyk@users.noreply.github.com>
@wRAR
Copy link
Member

The test passes without the download handler changes so we need a better one, but I'm not sure whether is it possible. It looks like v6 proxies are indeed (as the issue discussion says) supported in master when used with an IP so we need to use a hostname?

__init__ from IP specific client end-points moved to TunnelingMixinSigned-off-by: Vasiliy Kiryanov <vasiliy.kiryanov@gmail.com>
Signed-off-by: Vasiliy Kiryanov <vasiliy.kiryanov@gmail.com>
Signed-off-by: Vasiliy Kiryanov <vasiliy.kiryanov@gmail.com>
@vasiliyk
Copy link
ContributorAuthor

The test passes without the download handler changes so we need a better one, but I'm not sure whether is it possible. It looks like v6 proxies are indeed (as the issue discussion says) supported in master when used with an IP so we need to use a hostname?

We can show that the correctClientEndpoint selected with a test that monkeypatchessocket.getaddrinfo to return an IPv6 result and assertsScrapyProxyAgent._getEndpoint chooses aTCP6ClientEndpoint.
Still thinking about a better test :]

def_make_agent(proxy_uri:bytes):agent=ScrapyProxyAgent(reactor=reactor,proxyURI=proxy_uri)# a minimal endpointFactory expected by _getEndpointagent._endpointFactory=type("EF", (), {"_connectTimeout":5.0,"_bindAddress":None})()returnagentdeftest_hostname_resolves_to_ipv6(monkeypatch):# Simulate DNS resolving the hostname to an IPv6 addressdeffake_getaddrinfo(host,port,*args,**kwargs):return [            (socket.AF_INET6,socket.SOCK_STREAM,socket.IPPROTO_TCP,"", ("::1",0,0,0))        ]monkeypatch.setattr(socket,"getaddrinfo",fake_getaddrinfo)agent=_make_agent(b"http://ipv6-resolves.example:8080")endpoint=agent._getEndpoint(agent._proxyURI)assertisinstance(endpoint,TCP6ClientEndpoint)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@wRARwRARwRAR left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Only IPv4 proxies are supported

2 participants

@vasiliyk@wRAR

[8]ページ先頭

©2009-2025 Movatter.jp