Node.js UDP for realtime multi-player game
===

I am building a real-time multi-player browser-based game using node.js. At the moment I have the client send user input to the game logic server via socket.io and a snapshot of the game world sent back to the client for rendering.

Below is a simplified version of the code. Is it possible to use UDP to send data from the browser-based client to the server and vice-versa? I know Node.js has a [UDP module][1] but I am unsure how to implement it in this way. 

Any help would be appreciated. Thank you.

Server:


    var server = http.createServer(handler).listen(8888);
    var iosocket = io.listen(server);
    
    // request/response handler
    function handler(req, res){
        
        ...
    }
    
    iosocket.sockets.on('connection', function(socket){
        console.log("[x] Socket listener started");
        
        socket.on('msg', function(data){
            console.log( " [-] incoming message);
        });
    });

    ...

    iosocket.sockets.emit("message", msg);



Client:

    <!DOCTYPE html>
    <html>
    	<head>
    		<title>Test</title>
    		<script type="text/javascript" src="/socket.io/socket.io.js"></script>
    		<script type="text/javascript">
                socket.on('connect', function(){
	             console.log("connected to server");
                });

                socket.on('message', function(message){
	            console.log('received message');
                });

    		</script>
    	</head>
    
    	<body>
    		<canvas id='canvas' width="400" height="400">Canvas</canvas>
    	</body>
    
    </html>


  [1]: http://nodejs.org/api/dgram.html