HumbleNet
HumbleNet is a cross platform networking library that utilizes WebRTC and WebSockets to handle network communication.
Using WebRTC and Websockets allows HumbleNet to support not only traditional platforms such as Windows, OS X, and Linux, but also web platforms such as ASM.JS / Emscripten.
Language Support
HumbleNet is a simple clean C based API that allows for wrappers to be written for any language that offers C binding.
Included Language Bindings
- C/C++
- a simple C header is available for both C and C++ development. There is also a BSD socket wrapper that will redirect the C socket API through humblenet.
- C#
- wrappers are included that work in Unity for its Desktop and WebGL platform support. They should also work in any other .NET application.
Demo applications
We have several demos to show off integrating HumbleNet.
TestPeer
This is a simple "chat" app in the tests folder for both C and C#. The C app will run on Windows, MacOS X, Linux, and Emscripten. The C# will run on .NET or Mono.
Quake 2
We have a port of Quake2 (Based on R1Q2) that includes HumbleNet networking and runs on Windows, Mac OS X, Linux and Emscripten.
Quake 3
We have a port of Quake3 (Based on QuakeJS) that includes HumbleNet networking and runs on Windows, Mac OS X, Linux and Emscripten.
Build Instructions
Project Dependencies:
- CMake (https://cmake.org/):
- Linux: use your preferred package manager, like
apt-get
. - Mac: can be installed using
brew
. - Win: download the installer via site https://cmake.org/download/.
- Linux: use your preferred package manager, like
- Make (https://www.gnu.org/software/make/manual/make.html)
- Unix: already installed.
- Win: you can use Cygwin.
- FlatBuffers (https://google.github.io/flatbuffers/index.html)
- Download the source code. The HumbleNet is way behind the current version of FlatBuffers. It's using the version 1.6.0 (currently 1.7.1).
- Follow the instructions here (https://google.github.io/flatbuffers/flatbuffers_guide_building.html);
- You should get as result the
flatc
compiler executable. - Put your output directory (where the
flatc
exists, generally abuild
dir) into yourPATH
, so the compiler can be accessed anywhere.
- Go Language here
- Download and install the compiler via download page.
- Test on your terminal if you can execute
go version
; - Tested here with version
go1.9.1 darwin/amd64
.
Compilation:
- Download the project from github;
- Go the downloaded folder;
- Create a
build
folder (just to better organize the output code) and enter the directory; - Run the command:
cmake ..
(with 2 dots), this will configure into the directory all files needed to build the library; - Now it's need to copy the FlatBuffers include files:
- Go to folder where you downloaded the FlatBuffers;
- Copy the folder
flatbuffers
inside theinclude
dir; - Go back to your
<HumbleNetDir>/build
folder; - Paste the
flatbuffers
folder into thehumblenet
dir, along side thehumblepeer_generated.h
file; - This folder contains the
flatbuffers.h
file, that is a source dependency.
- From the
build
folder you can run themake
command alone, and it will try to build all code, or with the desiredtarget
, example:make all
: will build all executables and libraries;make clean
: will clean the directory, but mantain the config files;make humblenet_test_peer
: build the test peer found in<HumberNetDir>/tests/test_peer.cpp
;make peer-server
: will build the test server found in<HumbleNetDir>/src/peer-server
;