Skip to content

Commit

Permalink
Use 0.0.0.0 as default host
Browse files Browse the repository at this point in the history
  • Loading branch information
IoTMOD committed Dec 12, 2019
1 parent ca21dac commit 58133b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/zeromq/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import flag "github.com/spf13/pflag"

func init() {
flag.String("zmq.protocol", "tcp", "protocol used to connect to the zmq feed [unix, tcp, udp, inproc]")
flag.String("zmq.host", "*", "host used to connect to the zmq feed")
flag.String("zmq.host", "0.0.0.0", "host used to connect to the zmq feed")
flag.Int("zmq.port", 5556, "port used to connect to the zmq feed")
}
5 changes: 2 additions & 3 deletions plugins/zeromq/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ func NewPublisher() (*Publisher, error) {

// Start the publisher on the given port.
func (pub *Publisher) Start() error {
port := parameter.NodeConfig.GetInt("zmq.port")
endpoint := parameter.NodeConfig.GetString("zmq.protocol") + "://" + parameter.NodeConfig.GetString("zmq.host")
return pub.socket.Listen(endpoint + ":" + strconv.Itoa(port))
endpoint := parameter.NodeConfig.GetString("zmq.protocol") + "://" + parameter.NodeConfig.GetString("zmq.host") + ":" + strconv.Itoa(parameter.NodeConfig.GetInt("zmq.port"))
return pub.socket.Listen(endpoint)
}

// Shutdown stops the publisher.
Expand Down

0 comments on commit 58133b6

Please sign in to comment.