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

feature: Fix the problem of connecting pure ipv6 domain names #1036

Merged
merged 2 commits into from
Mar 7, 2023

Conversation

zhang0281
Copy link
Contributor

修复一个由于ioredis的RedisOptions.ts 配置文件引起的问题。

ioredis默认设置family为4,这导致了在连接地址为 纯ipv6的域名 时,会报ENOTFOUND的错误。
Snipaste_2023-02-12_13-17-27

上游已经有了相关的Pull Request,但目前未被合并。所以提了这个Pull Request来修复这个问题。

@zhang0281
Copy link
Contributor Author

#844 是同样的问题。

@qishibo
Copy link
Owner

qishibo commented Feb 12, 2023

印象中处理过这个问题,当时加了family:6好像也不好用 #394
不过本地::1的这种形式应该是支持的,你的是真实v6地址然后报错是么

@zhang0281
Copy link
Contributor Author

域名映射是这个情况。

Snipaste_2023-02-12_18-49-43

地址的话,是真实的v6地址。我这边测试是加上family: 6 之后,连接就不报错了。

@qishibo
Copy link
Owner

qishibo commented Feb 13, 2023

手头上还真没有ipv6的机器,加上你的配置项后ipv4的ip和域名还能正常连接么

@zhang0281
Copy link
Contributor Author

我之前忘测试ipv4的域名连接了。

如果family值设置为6的话,同样会导致ipv4的域名无法连接。

查过文档之后,family设置为0时可以同时返回ipv4和ipv6的地址。

经过测试,family的值设置为0时,ipv4的ip,域名、ipv6的ip,域名都是可以连接的。

@qishibo qishibo merged commit f805cde into qishibo:master Mar 7, 2023
@qishibo
Copy link
Owner

qishibo commented Mar 7, 2023

棒!

@maxpain
Copy link

maxpain commented Mar 11, 2024

Any updates on 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.

None yet

3 participants