rocketmq-client-go
rocketmq-client-go copied to clipboard
VerifyIP blocked DNS style
BUG REPORT
-
Please describe the issue you observed:
-
What did you do (The steps to reproduce)? I deploy rocketmq on k8s, and use coreDNS addr to connect it. then i was blocked by VerifyIP function
-
What did you expect to see? do not intercept connect when the addr not like ipv4 and ipv6 if the addr actually wrong, the tcp connection will failed and it will sign definite error
-
从现在的逻辑看,是需要检查namesrv地址的有效性,目前支持以下几种:
- ipv4
- ipv6
- http://或者https://开头。
这个检查没有覆盖namesrv1.com, namesrv1.com;namesrv2.com这种域名场景, 非常欢迎你提交PR修复它。
VerifyIP()代码: https://github.com/apache/rocketmq-client-go/blob/26142da1b88ef22ac018138c724f5d4f48059da3/primitive/base.go#L33-L86
https://github.com/apache/rocketmq-client-go/pull/1010 PR 在这里, 顺便改了使用net包校验ipv4,6 url host:port的方式
@francisoliverlee 这个pr有计划merge么,我们确实需要通过coreDNS来访问Namesrv