freeport
Version, currently 0.1.01 version
- 0.1.0latestJan 27, 2019
github.com/petoem/freeport
Get a free and open TCP port that is ready to use
1 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
freeport:
github: petoem/freeport
version: ~> 0.1.0Then run:
shards installshard.yml
- Crystal
0.27.0- License
- MIT
- Author
- Michael Petö
- Target
freeportfrom src/cli.cr
Dependencies
Development Dependencies
- ameba0.9.0github: veelenga/amebadev
README
freeport
Get a free and open TCP port that is ready to use. Inspired by FreePort.
Installation
Command Line
Download the executable from the release page or build from source with shards build.
Library
Add this to your application's shard.yml:
dependencies:
freeport:
github: petoem/freeport
version: 0.1.0
Usage
Command Line
> freeport -h
Usage: freeport [arguments]
-n, --newline Print port number with a newline
-v, --version Output version information and exit
-h, --help Show this help
Library
require "freeport"
# Returns a free TCP port, may raise an exception if no free ports are available.
FreePort.get
# Returns a free TCP port or `nil`.
FreePort.get?
Limitation
freeport returns a port available at the moment, a race condition may occur and the port could be taken by the time you try binding to the port yourself.
Contributing
- Fork it!
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Michael Petö - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Jan 27, 2019
- Commit
047ee417f752- Crystal
0.27.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/petoem/freeport
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 14, 2026
- Versions
- 1