Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 968 Bytes

File metadata and controls

26 lines (16 loc) · 968 Bytes

multilisten

Documentation

multilisten is a Go package for bundling multiple net.Listeners into a single one.

This package is useful when a third-party package expects a single net.Listener to build some service, but you would actually like to listen on several endpoints (ports, specific interfaces, files).

Install

go get github.com/TheCount/go-multilisten/multilisten

Usage

For the detailed API, see the Documentation.

Essentially, all you have to do is bundle your listeners like this:

bundle, err := multilisten.Bundle(l1, l2, l3)

and then use bundle like a single listener. It will accept from l1, l2 and l3 simultaneously.