keijack / python-eureka-client

A eureka client written in python. Support registering your python component to Eureka Server, as well as calling remote services by pulling the the Eureka registry.
MIT License
184 stars 43 forks source link

ipv6 support #11

Closed Jovons closed 5 years ago

Jovons commented 5 years ago

the following code makes the client not usable with eureka server in ipv6 ip:

(_URL_REGEX = re.compile(
    r'^(?:http)s?://'  # http:// or https://
    r'(([A-Z0-9_~!.%]+):([A-Z0-9_~!.%]+)@)?'  # basic authentication -> username:password@
    r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'  # domain...
    r'(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?)|'  # domain name without `.`
    r'localhost|'  # localhost...
    r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'  # ...or ip
    r'(?::\d+)?'  # optional port
    r'(?:/?|[/?]\S+)), re.IGNORECASE)

def get_url_and_basic_auth(addr_url):
    addr = addr_url

    match_obj = _URL_REGEX.match(addr)
    groups = match_obj.groups())
sunxiang0918 commented 5 years ago

我今天做测试 也遇到这个问题了.... 在get_url_and_basic_auth时直接抛异常了

keijack commented 5 years ago

It supports IPV6 now, please use v0.7.1, thanks~ @Jovons @sunxiang0918