Coder Social home page Coder Social logo

libws's Introduction

libws (alpha)

Build Status Coverage Status

libws is a multi-platform, non-blocking C websocket client library based on Libevent.

Note This project is currently in an Alpha state. A work in progess. Any bug reports are welcome.

Project aim

The aim of this project is to create a non-blocking portable websocket client library in C. Currently there are no plans to implement the server part of the protocol. There are lots

Some design goals:

  • Full RFC6455 compatability.
  • Use the C89 standard for best portability.
  • CMake build system with system introspection.
  • Intuitive and stable API.
  • Message based, frame based and streaming API.
  • Full unit test suite.
  • Both WS and WSS support.
  • Should pass the entire Autobahn Test Suite.
  • Support for Windows, Linux and OSX, as well as other Unix OS versions.

Building

To build the project using CMake.

Unix

$ mkdir build && cd build
$ cmake ..
$ ctest # Run all tests, use --help for extra settings
$ bin/libws_tests # Get a menu and run a specific test manually.

Windows

From the git bash console:

$ git submodule update --init deps/libevent # Make sure we have Libevent.
$ ./build_deps.sh
$ mkdir build && cd build
$ cmake -DLibevent_DIR=deps/libevent .. # We must specify the Libevent location.

Test suite

Both the regression tests and Autobahn Test Suite are run continously on Linux/OSX using Travis-CI on any push or pull request done on this repository. Statistics about the coverage of the unit tests is uploaded to Coveralls on each build as well.

Regression tests

libws has a set of regression tests that can be run using CTest. If valgrind is detected, these tests are by default run using valgrind to detect any memory leaks (this can be turned off by setting cmake -DLIBWS_WITH_MEMCHECK=OFF ..).

$ mkdir build && cd build
$ cmake ..
$ ctest # Run all tests, use --help for extra settings
$ bin/libws_tests # Or get a menu and run a specific test manually.

Autobahn Test Suite

The Autobahn Test Suite is a set of tests that verifies that a websocket endpoint is behaving according to the websocket standard. Libws implements a client that can run towards the Autobahn fuzzingserver.

Currently libws passes all tests (excluding the extension tests, which are optional).

To build and run these tests first you need to install the test suite itself and start the fuzzing server:

$ sudo pip install autobahntestsuite
$ wstest -m fuzzingserver --debug & # Start in the background (or a separate screen if you like).

Then you can run the autobahn client:

$ git submodule update --init # We need some extra dependencies.
$ mkdir build && cd build
$ cmake -DLIBWS_WITH_AUTOBAHN=ON ..
$ bin/autobahntest --config ../test/autobahn/libws.cfg # Use the default config.
$ bin/autobahntest --help

To see detailed results for all tests surf to http://localhost:8080

libws's People

Contributors

alber2510 avatar alxvasilev avatar javiserrano avatar joakimsoderberg avatar sergiohs84 avatar

Watchers

 avatar

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.