Free up to 1MM monthly messages. No credit card required.
The WebRTC Peer Connection makes a direct connection between two browsers so they can pass data between them. Though WebRTC is known for its audio and video capabilities, we at PubNub are interested in the Data Channel API. The Data Channel allows the passing of arbitrary data across this connection. This means your users can now share data directly with each other. This secure connection is great for applications that need to work with high performance and low latency communication such as fast action video games or large scale file sharing. For those that are familiar with establishing a peer connection the API is fairly simple:
We now have a way for our users to communicate directly with each other at no cost to the developer! The Data Channel API currently supports most generic forms of data including strings, blobs, and array data. This makes it easy to share any piece of information encoded in your favorite flavor such as JSON or XML. The Data Channel also supports UDP which makes this the fastest speed you can get for sending data from one user to another.
Most readers are probably thinking, “Why would I ever use anything else ever again?” This connection may open up a number of possibilities, but no application is going to be comprised of only peer connections. There are still plenty of issues:
To investigate a lot of these issues, the team at PubNub built a WebRTC framework for making peer connections easily. We take all the guesswork out of sending SDP packets back and forth and give an easy to use API for sending data to another user. Because it’s all build on PubNub, there’s no need to set up any servers to make this happen. We went from hundreds of lines of code to a few simple steps:
Be sure to check out the getting started section on our GitHub page here: https://github.com/pubnub/webrtc
I personally believe this opens the doors for a lot of innovative web development. There are already great examples using the data channel such as file sharing applications and chat clients, including our P2P file-sharing app PubShare. We envision plenty of use cases for this technology like multiplayer games, networked storage systems, and more. This is even now opened up to Chrome for Android so my mobile phone can talk to other phones and desktops directly.
If you think of the average server setup, it’s hundreds of servers replicating and speaking to each other across the globe. Now if you think of the average client setup, it’s one browser talking to a few server endpoints.
Looking into the future, what if we could change this model and have our client integrate within our server mesh? Clients could share data with each other making the network faster and more robust. They could even share data with clients that are closer to them, rather than the nearest data center. Overall, this makes the web a better (and more streamlined) place for everybody.
A roundtable discussion led by PubNub’s COO, Casey Clegg, exploring the topics of what it means to be human in a virtual world.
Dr. Joe Kvedar, Chair of the Board for the American Telemedicine Association, joins our COO, Casey Clegg, to discuss why...
Today, we are glad to announce that we are currently in the process of implementing ISO-27001 security standards.