Simple voice's matchmaking server. A VoIP solution just for learning WebRTC. Seems to be working on KaiOS browser(tested on 2.5.1 with Nokia 8110 4G)
Farooq Karimi Zadeh c43065e293 mistake fixed | 3 years ago | |
---|---|---|
static | 3 years ago | |
.gitignore | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
index.html | 3 years ago | |
simplevoice_server.py | 3 years ago |
Simple voice's server written in Python and with CherryPy. This works fine on KaiOS browser tested on KaiOS 2.5.1 browser(Nokia 8110 4G)
Demo with almost broken TURN server(I need one) but works(most likely).
Just to learn WebRTC and to see how can I make it work on KaiOS. Just this
The docs are incomplete and perhaps incorrect.
<room_name>
is... well no standard for this yet.<client_id>
is an alphanumberic all lowercase 16 characters ID for client.Input and
/?name=<room_name>
Front-end written with HTML, CSS, Javascript and perhaps <3
!
/join?name=<room_name>
Join the given room.
If the client is the first one requesting to join the room, a JSON containing its ID will be given to it as payload and it should use /get_answer
to get "SDP answer". A list of STUN and TURN servers will be also given to the client. The JSON will be something like {"ID": "...", "Servers": [...]}
If somebody has already joined this room the client will immediately receive "SDP offer" + a 16 character alphanumberic ID which is client's and the client must respond with /answer
API with "SDP answer". Like this: {"ID": "...", "data": {...answer...}}
If there are already 2 clients which has joined the room, a JSON containing an error message will be returned: {"type": "RoomFull", "msg": "The room you are trying to join is already full"}
In the case of any other error, such a JSON the client will get: {"type": "InvalidState", "msg": "State is invalid!"}
/get_answer
client_id:str
Returns the "SDP answer" from the second client in this format:
{"data": {...answer...}}
Or will return exactly this JSON if there was no answer in up to 10 seconds and client should send another request immediately...
{"again": "again"}
/answer
client_id:str
data:JSON/DICT
Send the answer back to the first client, with a JSON like this:
{"data": {...answer...}}
Returns the "SDP offer"
/leave
client_id:str
room:str