Node.js as a WebRTC proxy - node.js

I have a Raspberry Pi 3 with a camera module. I've installed uv4l, and that gives me the ability to access the camera stream from browser by creating a WebRTC connection from the browser. However, I want to have an extra layer between the client (browser) and uv4l WebRTC stream.
Is there a way to have a Node.js server, which would be a bridge between my client (browser) app and the uv4l stream?

Related

socket.io slow on mobile device

I have a node.js app that sends live data to the client via socket.io (Websocket transport) to draw a canvas (the client receives and uses data to draw to canvas).
I use socket.io-client to connect to the socket.io server.
This works fine (at least to an extent) on PC but very slow on mobile devices (that support WebSocket).
Note: App is hosted on Azure and I am saying most data on Local Storage for better performance.
What can be the cause of the lagging and frequent disconnection on mobile phones but good connections on PCs?

webrtc connection between server to browser

I want to connect webrtc peer connection between node js server and browser. I will be sending the video stream to server using ffmpeg. Since connection will establish between server and client, client will recieve the stream to display the stream. Note: My actual situation is robot will be streaming the video to browser.
Can any one suggest how can i solve this scenario.

How to get WebRTC MediaStream to Node JS

I just want to know to get webrtc media stream to the node js server and serves it to the clients connected to that server.
I already created P2P WebRTC application with node js signalling server and it works fine. But now wants to route the media stream through the server. It should have low latency and delay to make it work at live server.
What you need is a SFU (Selective Forwarding Unit). Like these
mediasoup
janus-gateway
kurento
Here is a github project where it is implemented using mediasoup.

RTSP Camera P2P Connection without Port Forwarding and Console Application

I am trying to connect Remote RTSP Stream from IP Camera, but unable to get it without port Forwarding or Client Application. Is there any procedure to connect RTSP stream from one network to other network without port forwarding?
I have already tried with application client from hikvision and checked Wireshark streams but unable to get it
cam = cv2.VideoCapture("rtsp")
Take a look at the Nabto P2P platform, it is designed exactly to solve this problem, free for personal use and test / R&D. The Nabto blog has specific examples for setting up RTSP P2P tunnelling on cameras, Raspberry Pi devices and ESP32 devices:
You can either install the Nabto P2P reverse proxy in front of your RTSP service on the camera as a standalone process - or you can integrate it into an existing application. Full source is available in github.
On the client side, you can use an existing Nabto enabled RTSP client - or build your own based on the client SDKs, available for most popular platforms. Existing client apps available in github and in App store / Google Play.

Would socket.io receive data sent via websockets?

I have this IoT device that I am trying to connect to the server via wifi to send real time data. The server uses socket.io with node.js, but the wifi module (esp8266) I am using only has a websocket package. Would a socket.io connection be able to receive data sent via websocket?
Yes, but it will be a bit of a kludge:
socket.io supports multiple transports, of which one of them is a websocket. You can connect using only the websocket, but you will need to implement the socket.io protocol.
https://github.com/socketio/socket.io-protocol
If you are using a popular platform, there may be libraries available, i.e. for Arduino, there is:
https://github.com/billroy/socket.io-arduino-client

Resources