rocketmq-client-go icon indicating copy to clipboard operation
rocketmq-client-go copied to clipboard

VerifyIP blocked DNS style

Open aireet opened this issue 2 years ago • 3 comments

BUG REPORT

  1. 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

aireet avatar Dec 14 '22 09:12 aireet

从现在的逻辑看,是需要检查namesrv地址的有效性,目前支持以下几种:

  1. ipv4
  2. ipv6
  3. http://或者https://开头。

这个检查没有覆盖namesrv1.com, namesrv1.com;namesrv2.com这种域名场景, 非常欢迎你提交PR修复它。

VerifyIP()代码: https://github.com/apache/rocketmq-client-go/blob/26142da1b88ef22ac018138c724f5d4f48059da3/primitive/base.go#L33-L86

francisoliverlee avatar Feb 22 '23 03:02 francisoliverlee

https://github.com/apache/rocketmq-client-go/pull/1010 PR 在这里, 顺便改了使用net包校验ipv4,6 url host:port的方式

aireet avatar Feb 26 '23 17:02 aireet

@francisoliverlee 这个pr有计划merge么,我们确实需要通过coreDNS来访问Namesrv

aireet avatar Jun 12 '23 13:06 aireet