How can i send images in p5.js with socket.io

if I have this:

var img; function setup() { createCanvas(600,600); } funcion draw(){ image(img,0,0); }

//this function allows me take and drag an image up to the canvas function gotFile(file) {

if (file.type === 'image') {

    img = createImg(file.data).hide();


} else {
    println('Not an image file!');
}
}

if I use p5.js, I would like to know how can I send a image from a computer to another using socket.io. And how can I use the variable img in socket.io

Sign In or Register to comment.