I'm working on a project which should allow users to connect with one another (1 on 1) and chat via the website. If I go with the http://peerjs.com/ implementation or another custom solution for WebRTC peer connection, will I need a server to broker the connections? If so, what's the purpose of it? I thought the whole point of WebRTC peer connection was to allow for direct user-to-user connections.
Does PeerJS or WebRTC peer connection require a server or it's only between clients?
1.7k views Asked by DecafJava AtThere are 2 answers
mattm
On
Peers need some way to find one another and setup a media connection. A server is a convenient way to do this. You can setup a direct connection for signaling to exchange SDP messages, but whether this will work depends on whether you know the addresses of endpoints and firewalls are configured correctly. Mobile phones and laptops, for example, will have IP addresses that change frequently, which makes locating them directly difficult. The process of exchanging information to start the peer connection is called signaling.
The media in a peer connection is sent normally between peers, though you can also do things like send media through a TURN server.
The signaling portion of the WebRTC process is very lightweight compared to the media sent over the peer connection. Due to the simplicity of using a server for signaling, servers are frequently used for signaling.
Related Questions in JAVASCRIPT
- Angular Show All When No Filter Is Supplied
- Why does a function show up as not defined
- I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
- Set "More" "Less" font size
- Using pagination on a table in AngularJS
- How to sort these using Javascript or Jquery Most effectively
- how to fill out the table with next values in array with one button
- State with different subviews
- Ajax jQuery firing multiple time display event for the same result
- Getting and passing MVC Model data to AngularJS controller
- Disable variable in eval
- javascript nested loops waiting for user input
- .hover() seems to overwrite .click()
- How to sort a multi-dimensional array by the second array in descending order?
- How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
Related Questions in CHAT
- PHP chat submit refresh button
- UCWA: integrating advanced chat options
- What technologies should I use to create a real time One to One chat?
- Mysterious number of chars read with read() in simple chat in C?
- Android pubnub chat using parse giving incorrect authentication key error
- jquery chat with time
- QuickBlox Chat not logging in
- Is it a good idea to use push notifications for mobile chat applications? (Android, iOS)
- JavaFX chat Application
- Framework for chat server using AKKA
- Scalable private message system
- Chat application using CFWebsocket
- Quickblox: not getting contact list from EJabber
- Create a job in Parse which delete all old objects in all Classes
- GCM and quickblox pushnotification
Related Questions in WEBRTC
- Firefox 37 throwing error when trying to add microphone volume control for WebRTC audio context
- One to One screensharing using WEBRTC
- simpleWebRTC with php backend
- TURN server for WebRTC with REST API authentication
- Configure Asterisk as SIP outbound proxy (as a SIP server relay)
- Quickblox Group Video Calls with Javascript SDK
- WebRTC on isolated LAN without ice/stun/turn server
- Is it possible to have two screen-share sections on the same page?
- How set rear camera stream in WebRTC video chat
- How to use different network interface for signaling & media in WebRTC app?
- How to change dynamic video resolution during a call (in hangout WebRTC)
- Why does video resolution change when streaming from Android via WebRTC
- How to modify the content of WebRTC MediaStream video track?
- WebRTC Ice State = "failed" black Video
- WebRTC PeerJS Text Chat - Connect to multiple peerID at the same time
Related Questions in PEERJS
- WebRTC PeerJS Text Chat - Connect to multiple peerID at the same time
- Implementing PeerJS Server with multiple dynos on Heroku
- WEB RTC, Peer JS and NAT
- How to set connection between chrome extension and browser using P2P/WebRTC
- Add Answer to peerJS script
- PeerJS peer not receiving data
- Custom Server with peerjs - no documentation has left me clueless
- PeerJS: Other Peer Detected but Connection Not Open
- PeerJS + Angular4 - how to turn on/off camera and microphone while streaming
- How to call without self stream?
- PeerJS Server connecting SSL
- Deploy Heroku with App has more than 1 running command
- How to fixed websocket invalid frame header?
- PeerJS deploy on Heroku listen EACCES: permission denied 0.0.0.0:443
- How to change a live stream during call between peers in PeerJs?
Related Questions in PEER-CONNECTION
- WebRTC Ice State = "failed" black Video
- gdb load debug-info failed, get Dwarf Error when I debug webrtc peerconnection_client
- RTCPeerConnection - MediaStreamTrack has only black frames when restreaming it from external source
- WebRTC with multiple Peer Connections - Stream between existing peer connections stop when a new connection is created
- WebRTC issue - Hololens unable to send video offer
- Web RTC Peer Discovery
- Use Single PeerConnection for two different plugins of janus (VideoRoom & AudioBridge) in one Android Activity - Android
- How to remove camera icon from the browser address bar even after closing the video streams
- How to make a turn server on node.js for peer connection
- "iceConnectionState" is "failed" without any error
- WebRTC createOffer error <unavailable>
- How i create peer-connection without localStream?
- Does PeerJS or WebRTC peer connection require a server or it's only between clients?
- How to establish peer connection in web app using coturn (stun/turn) server
- Real time video
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Direct user to user connection means P2P connection is when two users exchange data directly without any relay server in the middle. But for them to be that way they need to first connect to each other. And for that they need each other IP addresses and other related information.
Two devices on internet can't know each other addresses unless someway they exchange these infos between them. That's why a Signaling server like SIP,XMPP are used. Peers log into these servers for exchanging these IP information. When Peer A and Peer B are logged into say in a SIP server then when peer A wants to communicate with peer b,
1) A will send its IP info to the sip server. Sip server will forward this info to B.
2) Upon receiving the information peer B will send its IP addresses to the SIP server and SIP server will forward it to Peer A.
3) After they both know each others IP information they can then connect with each other directly without the using the SIP server again.
This is what P2P connection is. It uses signaling server only for creating connection between peers after that its P2P connection.
But P2P connection is not always possible even after knowing all the Ip information of each peers. There are some NATs which makes it impossible to create P2P connection. But that is another topic.
Hope this clears up your confusion.