npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-dtls-proxy

v0.0.6

Published

Node.js DTLS Proxy, library and tools to connect plain-text UDP clients with plain-text UDP servers over an encrypted tunnel..

Downloads

5

Readme

node-dtls-proxy

Node.js DTLS Proxy, library and tools to connect plain-text UDP clients with plain-text UDP servers over an encrypted tunnel..

Requirements

  • nodejs version 4 or higher
  • npm

Nodejs and NPM installation:

$ sudo apt-get install nodejs nodejs-legacy npm

Checking Nodejs version:

$ node --version

Upgrading Nodejs to version 4x:

wget -qO- https://deb.nodesource.com/setup_4.x | sudo bash -
sudo apt-get install nodejs

Package Installation

From npm

$ npm install -g node-dtls-proxy

From Source

$ git clone https://github.com/m4n3dw0lf/node-dtls-proxy
$ cd node-dtls-proxy
$ sudo npm install -g
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout cert.key -out cert.crt -subj '/CN=node-dtls-proxy/O=m4n3dw0lf/C=BR'

Example

  • Create 2 VMs, one for the Server and one for the Client and install the package.

Server-side

  • On a terminal
$ dtls2udp <DTLS_LISTEN_PORT> <UDP_LISTEN_PORT> <UDP_ENDPOINT_IP> <UDP_ENDPOINT_PORT>

e.g:

$ dtls2udp 5684 5685 localhost 5683
  • On another terminal
$ node examples/server/udp_server.js

Client-side

  • On a terminal
$ udp2dtls <UDP_LISTEN_PORT> <DTLS2UDP SERVER IP> <DTLS2UDP SERVER PORT>

e.g:

$ udp2dtls 5687 localhost 5684
  • On another terminal
$ node examples/client/udp_client.js

Docker-Compose Example

run docker-compose up

NOTE: remember to generate the certificate and key pair

this will start the dtls2udp and udp2dtls proxies.

for real scenarios, you will need to split the dtls2udp service in one server and the udp2dtls service to the other server.

Start the UDP Server sample

$ node examples/server/udp_server.js

Request using the UDP Client sample

$ node examples/client/udp_client.js

Check the result on the docker-compose output

udp2dtls    | [+] Starting UDP2DTLS Proxy
dtls2udp    | [+] Starting DTLS2UDP Proxy
udp2dtls    | UDP Server listening on port: 5687
dtls2udp    | DTLS Server listening on port: 5684
dtls2udp    | UDP Server listening on port:  5685
dtls2udp    | Got a DTLS Connection from: 127.0.0.1:55209
udp2dtls    | Encrypting UDP message from: 127.0.0.1:41585 and forwarding to DTLS2UDP endpoint
dtls2udp    | Decrypting DTLS message from: 127.0.0.1:55209 and forwarding to UDP endpoint
dtls2udp    | Encrypting UDP response from: 127.0.0.1:5683 and forwarding to  UDP2DTLS endpoint
udp2dtls    | Decrypting DTLS message and forwarding to UDP client: 127.0.0.1:41585