zttp

0.0.2 • Public • Published

zttp

open http protocol service over the zmq STREAM socket.

based on ZMQ_STREAM and ideas from hintjens' web server.

install

there's an npm package dependency on zmq.

you'll need:

  • zeromq v4+ on your system
  • make sure zeromq.node works.
$ npm i zhttp

use

var z = require('zttp').listen('tcp://127.0.0.1:3000');
 
z.route('/zmq/endpoint', function(req,res){
 
  var response = '<!DOCTYPE html><head><meta charset="UTF-8"></head><body>'
    + '<p>Hello from zeromq.</p></body></html>' //for now just plain text html
 
  res.send(response);
 
});

MIT

Package Sidebar

Install

npm i zttp

Weekly Downloads

3

Version

0.0.2

License

MIT

Last publish

Collaborators

  • reqshark