https://github.com/thecount/go-multilisten
Bundle multiple Golang net.Listeners into a single one.
https://github.com/thecount/go-multilisten
golang-package listen network
Last synced: 5 months ago
JSON representation
Bundle multiple Golang net.Listeners into a single one.
- Host: GitHub
- URL: https://github.com/thecount/go-multilisten
- Owner: TheCount
- License: mit
- Created: 2020-06-01T19:37:29.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2025-10-28T22:11:34.000Z (8 months ago)
- Last Synced: 2025-11-22T14:53:59.936Z (7 months ago)
- Topics: golang-package, listen, network
- Language: Go
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# multilisten

[](https://godoc.org/github.com/TheCount/go-multilisten/multilisten)
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
```sh
go get github.com/TheCount/go-multilisten/multilisten
```
## Usage
For the detailed API, see the [Documentation](https://godoc.org/github.com/TheCount/go-multilisten/multilisten).
Essentially, all you have to do is bundle your listeners like this:
```golang
bundle, err := multilisten.Bundle(l1, l2, l3)
```
and then use `bundle` like a single listener. It will accept from `l1`, `l2` and `l3` simultaneously.