proxy.golang.org : github.com/smartcontractkit/freeport
Package freeport provides a helper for reserving free TCP ports across multiple processes on the same machine. Each process reserves a block of ports outside the ephemeral port range. Tests can request one of these reserved ports and freeport will ensure that no other test uses that port until it is returned to freeport. Freeport is particularly useful when the code being tested does not accept a net.Listener. Any code that accepts a net.Listener (or uses net/http/httptest.Server) can use port 0 (ex: 127.0.0.1:0) to find an unused ephemeral port that will not conflict. Any code that does not accept a net.Listener or can not bind directly to port zero should use freeport to find an unused port.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/smartcontractkit/freeport
License: MPL-2.0
Latest release: 3 months ago
First release: 6 months ago
Namespace: github.com/smartcontractkit
Stars: 0 on GitHub
Forks: 2 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 3 days ago