Skip to content

Instantly share code, notes, and snippets.

@ryanjon2040
ryanjon2040 / MyUDPServer.js
Last active September 22, 2021 09:06
Node.js udp server example http://wp.me/p2fInN-tA
// port to listen to
var PORT = xxxxx; // Change to your port number
// x's should be replaced with your EC2 private ip
var HOST = 'ip-xxx-xx-xx-xxx.your-region.compute.internal';
// Load datagram module
var dgram = require('dgram');
// Create a new instance of dgram socket