zeromq / gyre

Golang port of Zyre
GNU Lesser General Public License v3.0
88 stars 20 forks source link

Invalid port * after host #48

Open omani opened 4 years ago

omani commented 4 years ago

hi there, with the new golang version (and its built in url lib):

if !n.bound {
        _, n.port, err = bind(n.inbox, "tcp://*:*")
        if err != nil {
            return err
        }
        n.bound = true
    }

in node.go does not work anymore.

my workaround was to say:

if !n.bound {
        _, n.port, err = bind(n.inbox, "tcp://*:0")
        if err != nil {
            return err
        }
        n.bound = true
    }

in node.go

and:

    if p == "0" {
...

in node.go later. instead of if p == "*".

fyi.

aeroblue commented 4 years ago

I had the same issue and the changes suggested by @omani fixes it. According to the net/url docs:

validOptionalPort reports whether port is either an empty string or matches /^:\d*$/

@omani can you do a pull request or should I?

omani commented 4 years ago

yeah will do.

omani commented 4 years ago

done.