GithubHelp home page GithubHelp logo

rbfx / libjuice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paullouisageneau/libjuice

0.0 1.0 0.0 665 KB

JUICE is a UDP Interactive Connectivity Establishment library

License: Mozilla Public License 2.0

C 96.87% Makefile 0.31% CMake 2.81%

libjuice's Introduction

libjuice - UDP Interactive Connectivity Establishment

License: MPL 2.0 Build and test Gitter Discord AUR package Vcpkg package

libjuice ๐Ÿ‹๐Ÿ’ฆ (JUICE is a UDP Interactive Connectivity Establishment library) allows to open bidirectionnal User Datagram Protocol (UDP) streams with Network Address Translator (NAT) traversal.

The library is a simplified implementation of the Interactive Connectivity Establishment (ICE) protocol, client-side and server-side, written in C without dependencies for POSIX platforms (including GNU/Linux, Android, Apple macOS and iOS) and Microsoft Windows. The client supports only a single component over UDP per session in a standard single-gateway network topology, as this should be sufficient for the majority of use cases nowadays.

libjuice is licensed under MPL 2.0, see LICENSE.

libjuice is available on AUR and vcpkg. Bindings are available for Rust.

For a STUN/TURN server application based on libjuice, see Violet.

Compatibility

The library implements a simplified but fully compatible ICE agent (RFC5245 then RFC8445) featuring:

  • STUN protocol (RFC5389 then RFC8489)
  • TURN relaying (RFC5766 then RFC8656)
  • SDP-based interface (RFC8839)
  • IPv4 and IPv6 dual-stack support
  • Optional multiplexing on a single UDP port

The limitations compared to a fully-featured ICE agent are:

  • Only UDP is supported as transport protocol and other protocols are ignored.
  • Only one component is supported, which is sufficient for WebRTC Data Channels and multiplexed RTP+RTCP.
  • Candidates are gathered without binding to each network interface, which behaves identically to the full implementation on most client systems.

It also implements a lightweight STUN/TURN server (RFC8489 and RFC8656). The server can be disabled at compile-time with the NO_SERVER flag.

Dependencies

None!

Optionally, Nettle can provide SHA1 and SHA256 algorithms instead of the internal implementation.

Building

Clone repository

$ git clone https://github.com/paullouisageneau/libjuice.git
$ cd libjuice

Build with CMake

The CMake library targets libjuice and libjuice-static respectively correspond to the shared and static libraries. The default target will build the library and tests. It exports the targets with namespace LibJuice::LibJuice and LibJuice::LibJuiceStatic to link the library from another CMake project.

POSIX-compliant operating systems (including Linux and Apple macOS)

$ cmake -B build
$ cd build
$ make -j2

The option USE_NETTLE allows to use the Nettle library instead of the internal implementation for HMAC-SHA1:

$ cmake -B build -DUSE_NETTLE=1
$ cd build
$ make -j2

Microsoft Windows with MinGW cross-compilation

$ cmake -B build -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake # replace with your toolchain file
$ cd build
$ make -j2

Microsoft Windows with Microsoft Visual C++

$ cmake -B build -G "NMake Makefiles"
$ cd build
$ nmake

Build directly with Make (Linux only)

$ make

The option USE_NETTLE allows to use the Nettle library instead of the internal implementation for HMAC-SHA1:

$ make USE_NETTLE=1

Example

See test/connectivity.c for a complete local connection example.

See test/server.c for a server example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.