1

I want to make a web app where you can send images in real-time. is there any way of doing it?? any video link or documentation link will be very helpful.

Thank You

1 Answer 1

1

As the official website says, socket.io can handle blob objects.

Starting in 1.0, it's possible to send any blob back and forth: image, audio, video.

For example, you can push documents from socket.io server-side like the following. Pushing from client-side to server-side is almost the same with this.

Server-side

const filePath = "./img.jpg" const imgBinary = fs.readFileSync(filePath) socket.emit("img",imgBinary) 

Client-side

socket.on("img", imgBinary => { const blob = new Blob([imgBinary]) const imgBlobUrl = window.URL.createObjectURL(blob) // Insert imgBlobUrl into img.src or something }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.