This is something I don’t get asked directly, but it does pop up from time to time. Especially when people come up with a specific language in mind and ask if it is suitable for WebRTC.
While the answer is almost always yes, I think a quick explanation of where programming languages meet WebRTC exactly is in order.
We will start with a small “diagram”, to show where we can find WebRTC related entities and move from there.
We’ve got both client and server entities with WebRTC, and I think the above depicts the main ones. There are more as your service gets more complicated, but that’s all an issue of scaling and pure development not directly related to WebRTC.
Learn how to design the best architecture for our WebRTC service in this new Advanced WebRTC Architecture course.
So what do we have here?
The web app is what most people think about when they think WebRTC.
This is what ends up running in the browser, loaded from an HTML and its derivatives.
What this means is that the language you end up with is Java Script.
When it comes to the mobile domain, there are two ways to end up with WebRTC. The first is by having the web app served inside a mobile browser, which brings you back to Java Script.
The more common approach though is to use WebRTC inside an app. You end up compiling and linking the WebRTC codebase as an SDK.
The languages here?
- C, C++ for the low level stuff that makes up WebRTC. In all likelihood, you won’t need to handle this (either because it will just work or because you’ll be outsourcing it to someone else)
- Java for native Android app development
- Objective-C and/or Switft for native iOS app development
Embedded is where things get interesting.
There are cases where you want devices to run WebRTC for one reason or another.
Two main approaches here will dictate the languages of choice:
- C, C++ if you port the webrtc.org code base and use it. And then whatever else you fancy on top of it
- Any language you wish (Java anyone?), while implementing what you need of the WebRTC protocol (=what goes on the network) on your own
In general, here you’ll be going to lower levels of abstraction, getting as close as possible to the machine language (but stopping at C most probably).
STUN and TURN servers are also necessary. Most likely – you won’t be needing to do a thing about them besides compiling, configuring and running them.
So no programming languages here.
I would note that the popular open source alternatives are all written in C. Again – this doesn’t matter.
The programming languages here depend on the media server itself. Jitsi is primarily Java based. Kurento is written in C/C++ with front ends typically written in Java or Node.js. Janus is mostly C. In most cases – you wouldn’t care.
Media servers are usually entities that you communicate with via REST or Websocket, so you can just use whatever language you like on the controlling side. It is a very popular choice to juse Node.js (=Java Script) in front of a Kurento server for example. It also brings us to the last entity.
The funny thing is that this is where the question is mostly targeted at. The application and/or signaling server is what stitches everything together. It serves the web app, communicates with the mobile and embedded apps. It offers the details of the TURN server and handles any ephemeral passwords with it, it controls the media servers.
And it is also where the bulk of the development happens since it holds the business logic of the application.
And here the answer is rather simple – use whatever you want.
- Node.js and Java Script are great and popular choice (there are good reasons for that)
- Java seems to be a thing in enterprises though for the life of me I just can’t understand why
- PHP works well. It is used by many WordPress plugins for WebRTC
- Erlang seems to be something that adventurous developers like to adopt – and like
- Ruby and Python are also good choices
- .Net is something I’ve seen once or twice used
In general, whatever you can use to build websites can be used to build a WebRTC service.
What’s your language?
Back to you. What is the programming languages you use with WebRTC?
If you are looking for developers, then what would be the languages you’d view as mandatory and which ones as preferable with applicants?
This as well as other topics are covered in my upcoming Advanced WebRTC Architecture course. Be sure to enroll if you wish to deepen your understanding in this topic.