6

I am trying to figure out a solution for a signaling server for an Android WebRTC based project. Both clients will be Android and both located close to each other, i.e. - within 100 yards or less. I would like the solution to work without the use of a public signaling server. I would rather just have one of the clients also act as the server.

So, my question is : 1. How can I achieve it so that one is the server? i.e. - Can I set one as a hotspot or use wifi direct? 2. If I can achieve #1, then what is a good solution for a signaling server running on android ? Can I run one of the nodejs servers on android ?

Sofia Clover
  • 669
  • 1
  • 7
  • 18

2 Answers2

4

A signaling server is simply a way to exchange messages between two parties. In the WebRTC case these messages are the offer/answer and ICE candidates.

You can use whatever type of server you want to do this, you can even do it manually :).

You can use one of the clients as the server too, but then you will have to communicate the IP to the other somehow. Maybe use Wi-Fi direct and get it programatically.

Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
  • Thanks Adrian. So, are you saying I do not even need a server in this scenario? I.e. - could i just use webrtc with straight web sockets over a local hotspot ? That way keeping the process within my app ? – Sofia Clover May 19 '16 at 17:52
  • Since I know the IP address of the clients, I don't need traverse the NATs. So wondering if i can do without the need for TURN, STUN and ICE candidates. – Sofia Clover May 19 '16 at 18:10
  • 2
    You do need a server, because you need somehow to transfer the messages automatically. But the server and the client can be in the same app. – Adrian Ber May 19 '16 at 19:01
  • 2
    You don't need a STUN/TURN server, but you do need the ICE process. – Adrian Ber May 19 '16 at 19:02
3

With WebRTC, signaling server is just the way to help you transfer your message, exchange your information (SDP package(createOffer/answer), exchange candidates etc).

Example : You can use GCM (Free) as a signaling server, or using Nodejs with socket.io, websocket, XMPP etc. Only thing you need is transfer your message between two peers.

You can refer to this tutorial : http://www.html5rocks.com/en/tutorials/webrtc/basics/

Khoa Tran
  • 528
  • 6
  • 18
  • Thanks @Khoatd, I understand the purpose of the signaling. My question is more in terms of what is a good mechanism to perform the signaling in my scenario - 2 android clients w/ no internet connection, assuming one acts as a server. – Sofia Clover May 19 '16 at 17:27