Skip to content

A native client library for WebRTC written in C and libdatachannel

Notifications You must be signed in to change notification settings

liraymond04/webrtc-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webrtc-client

A native client library for WebRTC written in C and libdatachannel (POSIX only because Windows does not have <pthread.h> or <uuid/uuid.h>, TODO: use Cygwin or cross-platform alternative libraries)

Requires a signalling server, rustysignal is the one I used during testing, and includes custom protocol for rooms used in the chat example

Examples

Use the -f to specify a path to a text file with ICE servers, or -s with a comma separated list of ICE servers

  • chat: TUI chat application using ncurses, use the help command to see what you can do!
  • game: Simple GUI "game" using olc PGE, see your friends shmovin' in real-time (or 60fps, give or take). Use the WASD keys to move around, and use Esc to exit the game.

Building

Prerequesites are cmake, ninja, and gcc, which you can install with your distribution package manager

Ex) Arch Linux

$ sudo pacman -S cmake ninja gcc

Generate CMake build files and start build

# You can pass in -DBUILD_EXAMPLES=OFF to only build the library
# and -DBUILD_STATIC_LIBS=OFF to build as shared library
$ cmake -B build -G Ninja
$ cmake --build build

And run one of the example applications

# Look in the examples folder to see what you can try,
# the executables should have the same names as their
# respective source files
#
# To pass in ice servers with -s, specify server URLs
# with the format specified in the libdatachannel docs
# ex) stun:stun.l.google.com:19302
# ex) turn:user:pass@turn.example.com:443
$ ./build/chat -f ice_servers.txt