Skip to content
This repository has been archived by the owner on Dec 30, 2021. It is now read-only.

alexstrat/simudp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simudp : udp for the browser.

Imitates exactly the dgram API in the browser and backed by socket.io/UDP proxy.

Installation

$ npm install simudp

Runs the proxy server :

var server = require('http').createServer();

require('simudp').listen(server);

server.listen(8080);

In the browser

<!-- you need to serve SimUDP.js by your own -->
<script src="/SimUDP.js"></script>
<script>
  
var socket = SimUDP.createSocket('udp4');

var hello = new SimUDP.Buffer('hello');

socket.send(hello, 0, hello.length, 3000, 'anywhere.com');

socket.on('message', function(buf, rinfo) {
  //...
});

//you've understood, it's dgram for the browser...
</script>

Doc

Read the sources (client and proxy) or ask around.

Browserify support

Simudp is fully compatible with browserfy. Best way is to use directly dgram-browserify.

About

NodeJS Socket.io/UDP proxy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published