Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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