javascript - Array being sent as String on node.js -


i doing experimenting socket.io. have canvas sends data server receives fine.

it receives uint8clampedarray correct because being sent.

when .send message server client, string: [object object]. again have checked! missing something, code server below:

var fs, http, io, server; fs = require('fs'); http = require('http'); server = http.createserver(function(req, res) {     return fs.readfile("" + __dirname + "/front.html", function(err, data) {         res.writehead(200, {             'content-type': 'text/html'         });         return res.end(data, 'utf8');     }); }); server.listen(1337); io = require('socket.io').listen(server); io.sockets.on('connection', function(socket) {     socket.on('publish', function(message) {          return io.sockets.send(message);     }); }); 

on client:

var datastr = json.stringify(data); // converts object string 

on server:

var dataobj = json.parse(data); // converts string object 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -