Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Peer-to-peer Javascript & something

I'm looking for a method to connect client(web browser) to server(without external IP) using p2p.

As client-side language i would like to use javascript.

I was reading about WebRTC Peer-to-peer but i don't know if it only works with two clients(javascript) or if i can use some other language ( PHP, Python, Node.js ).

I know about signaling, STUN and TURN servers. I have server with external IP address so it won't be a problem.

My question is what programming language can i use on the server?

like image 337
HealV Avatar asked Apr 30 '26 16:04

HealV


2 Answers

Actualy you can avoid other languages if you will use Kurento media server. It have javascript like native. And it frendly desiged to use it with Node.js backend.

Also Janus-Gateawey have commodious JavaScript API and allows build backend on any language you want. Managing all webRTC things happens on client side. That very cose if you understand webRTC and JS at least on basical level.

For control webRTC from back side on python you can use aiortc library

If you need to send/receive only text data then socket.io with e.g. python-socket.io (on server side) is that what you need

like image 139
Andrey Topoleov Avatar answered May 02 '26 04:05

Andrey Topoleov


I added to Andrey Suglobov's answer: The client does not receive the WebRTC packets from the server because it doesn't have an external IP. In order to solve this problem, you have to configure it to communicate via the TURN server in the middle.

[WebRTC server] ↔ [TURN] ↔ [NAT] ↔ [client]

Generally, the client uses JavaScript because it's a browser. But WebRTC is a specification that supports P2P on the web. If supporting this specification, it does not matter what programming language you use.

Thank you.

like image 41
AirenSoft Avatar answered May 02 '26 05:05

AirenSoft