http2udp

Forwards HTTP requests to UDP sockets.

Usage no npm install needed!

<script type="module">
  import http2udp from 'https://cdn.skypack.dev/http2udp';
</script>

README

http2udp

Build status

Forwards HTTP requests to UDP sockets.

What's the point?

At the time of writing, there is no way to send UDP packets from client-side JavaScript running in a web browser.

There may be other use cases for browser-based UDP but, for me, it is in order to send client-side RUM data to statsd, a popular monitoring server that receives data via UDP. UDP is a common choice for monitoring servers, where the issues of dropped packets and preserving transmission order are typically of little or no concern.

How does it work?

http2udp is a very basic HTTP server that runs on Node.js and forwards requests to UDP, based on the parameters of the request.

How do I install it?

Assuming that you already have Node.js and npm, you can install it globally like so:

sudo npm install -g http2udp

Or add it to your project's dependencies in package.json and run:

npm install

How do I use it?

From the command line

From another Node.js project

How do I set up the build environment?

What license is it released under?

MIT