Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcollina/udp-free-port
Get a free udp port, for node
https://github.com/mcollina/udp-free-port
Last synced: 2 months ago
JSON representation
Get a free udp port, for node
- Host: GitHub
- URL: https://github.com/mcollina/udp-free-port
- Owner: mcollina
- License: mit
- Created: 2016-03-08T12:09:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-15T08:27:38.000Z (over 7 years ago)
- Last Synced: 2024-10-06T01:48:23.797Z (3 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# udp-free-port
Get a free udp port, for node
## Install
```
npm i udp-free-port
```## Usage
```js
'use strict'freeUdpPort(function (err, port) {
if (err) {
throw err // or do something else
}// use your port!
var socket = dgram.createSocket('udp4')
socket.bind(port, function (err) {
if (err) {
throw err // or do something else
}})
})
```## Related
- [tcp-free-port](https://gitlab.com/sebdeckers/tcp-free-port)
## License
MIT