Skip to content

A fast HTTP/WebSocket to zeromq gateway (UNMAINTAINED, take a look at swindon web server instead)

License

Notifications You must be signed in to change notification settings

tailhook/zerogw

Repository files navigation

Zerogw

Zerogw is a http to zeromq gateway. Which means it listens HTTP, parses request and sends it using zeromq socket (ZMQ_REQ). Then waits for the reply and responds with data received from zeromq socket.

Starting with v0.3 zerogw also supports WebSockets. Websockets are implemented by forwarding incoming messages using ZMQ_PUB socket, and listening commands from ZMQ_SUB socket. Each WebSocket client can be subscribed to unlimited number of topics. Each zeromq message it either control message (e.g. subscription) or message to a specified topic which will be efficiently sent to every WebSocket subscribed to that particular topic.

Zerogw is written in C and uses libwebsite library for handling HTTP (which itself uses libev).

Zerogw is not a full-blown http server. It knows nothing about static files, caches, CGI, whatever. It knows some routing and that's almost it. That makes it very fast and perfectly scalable.

Use it for:
  • RPC's
  • REST API's
  • Ajax
  • WebSockets

Resources

Installing

Ubuntu:

sudo add-apt-repository ppa:tailhook/zerogw
sudo apt-get update
sudo apt-get install zerogw

ArchLinux:

yaourt -S zerogw

For other distributions refer to Compiling section.

We currently support only Linux.

Dependencies

  • linux with kernel at least 2.6.28 (need accept4)
  • libwebsite for handling http
  • coyaml for handling configuration
  • python3 needed for coyaml to build configuration parser
  • libzmq and libev of course
  • libyaml for parsing configuration

First two usually compiled statically, so you don't need them at runtime. Same with python. (Eventually, I'll release a bundle with precompiled configuration parser and embedded few other libraries for easier compiling :) )

Compiling

./waf configure --prefix=/usr
./waf build
./waf install

About

A fast HTTP/WebSocket to zeromq gateway (UNMAINTAINED, take a look at swindon web server instead)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •