Where can I find the best example of a safe Chatroulette or Omegle dating chat alternative?
Only2chat.com is a good solution! It has WebRTC in a secure way! No tracking of users and no data storage on their servers! If you try their solution you will see, this is state of the art WebRTC video chat like Chatroulette, Omegle and more.
How does it work ?
You've probably Chatroulette , Omegle , and many other video chat applications. Did you know that it is possible to develop a similar type of random video chat web application using only HTML and pure JavaScript using technology built into the browsers? This technology is called WebRTC.
requirements
You need an AWS account and some basic knowledge of AWS services and deployment with the Serverless Framework.
The following AWS services are used in this guide:
- Lambda service
- AWS EC2 instance (created and configured manually)
- AWS Websockets
- AWS DynamoDB
- AWS S3
- Make sure you have the following installed,
- Node 6.0 or higher
- AWS CLI configured for your account
WebRTC (Web Real-Time Communication)
WebRTC is a free, open-source project that provides web browsers and mobile applications with real-time communications (RTC) via simple application programming interfaces (APIs). It enables audio and video communication within web direct peer-to-peer communication within web pages and makes installing plugins or downloading native applications.
This communication is extremely fast and has low latency because the connection is peer-to-peer and there is no server in the middle. This technology was developed by Google and is currently supported by almost all browsers except the iOS platform (only Safari supports it).
Different API methods are supported in different browsers, which can make developing these applications difficult. these applications can make it difficult. It is to be hoped that these differences will disappear over time.
Why do we need this?
If we want two browsers running in two different parts of the world to be able to connect and exchange video chat streams in real time, we need a TCP or UDP connection like below for random video chat. WebRTC helps us make this connection.
How does it work?
Usually our PCs, laptops or cell phones are on a local network behind a NAT, a router and a firewall.
To create a direct connection from browser to browser, we have to deal with all these elements.
These layers between browsers attempting to establish a direct peer-to-peer connection make it
impossible to establish a connection without involving signaling mechanisms.
To deal with this, the following components are needed:
- A signaling mechanism
- STUN server
- TURN server
- Interactive Connectivity Manufacturing (ICE)
- Signaling process
ICE (Interactive Connectivity Manufacturing)
This is a coordination standard for Stun and Turn servers to establish direct communication between peers.
During the initial connection establishment signaling process, multiple ICE candidates are generated and peers select the one that is successful.
STUN server (Session Traversal Utilities for NAT)
This is a server that allows a peer to find its public IP address. When a peer wants to connect to another host, it specifies this public IP address as a potential connection endpoint.
If the existing NAT between the two peers allows a direct connection between the two hosts, then a direct peer-to-peer connection is established using an ICE (Interactive Connectivity Establishment). In this case a turn server is not required. If the Stun server cannot provide a working ICE, WebRTC then tries the Turn server.
TURN (Traversal Using Relay around NAT) Server
As the name suggests, this server routes media between hosts connected to it via an ICE. If you want to make a call between different networks or if NAT doesn't allow direct access to a host, this is the way to go. The turn server acts as a relay between the peers so that the peers do not have to find paths through their NATs.
The turn server has a public IP address that peers can connect to. The good thing is that we don't have to worry about this (when to use stun or turn) because the evaluation and connection establishment is done automatically by the WebRTC engine. However, we need to create and host our own stun/turn server (we will do that in another section).
Signaling process
Once the web socket connection is established, the process follows to establish a peer-to-peer connection.
- The caller and recipient connect to each other via a websocket connection.
- The caller creates an offer.
- The caller sends the offer to the recipient via the websocket connection.
- The caller receives ICE candidates from the Stun/Turn server.
- Caller sends all ICE candidates to the receiver via the websocket connection.
- The recipient accepts the offer.
- The recipient accepts the ICE candidates sent by the caller.
- The recipient creates a reply.
- The recipient sends the response to the caller over the websocket connection.
- The caller accepts the answer.
- The receiver tests the ICE candidates sent by the caller and selects the one that can connect successfully.
- A peer-to-peer connection is established between the caller and the recipient via an ICE connection.
That's it! Try it out and meet people from Germany in a random chat . At least you will get rid of the boredom while waiting for a response on a dating platform!