Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liraymond04/webrtc-client
A native client library for WebRTC written in C and libdatachannel
https://github.com/liraymond04/webrtc-client
c datachannel libdatachannel networking p2p peer-to-peer peerconnection rtcpeerconnection webrtc webrtc-client websocket
Last synced: 1 day ago
JSON representation
A native client library for WebRTC written in C and libdatachannel
- Host: GitHub
- URL: https://github.com/liraymond04/webrtc-client
- Owner: liraymond04
- Created: 2024-07-02T04:06:51.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-11T21:17:44.000Z (7 months ago)
- Last Synced: 2025-01-19T13:17:05.326Z (4 days ago)
- Topics: c, datachannel, libdatachannel, networking, p2p, peer-to-peer, peerconnection, rtcpeerconnection, webrtc, webrtc-client, websocket
- Language: C
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# webrtc-client
A native client library for WebRTC written in C and [libdatachannel](https://github.com/paullouisageneau/libdatachannel) (POSIX only because Windows does not have `` or ``, TODO: use Cygwin or cross-platform alternative libraries)
Requires a signalling server, [rustysignal](https://github.com/liraymond04/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](https://github.com/Moros1138/olcPixelGameEngineC), 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
```bash
$ sudo pacman -S cmake ninja gcc
```Generate CMake build files and start build
```bash
# 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
```bash
# 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:[email protected]:443
$ ./build/chat -f ice_servers.txt
```