Skip to content

scrapjs/zttp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zttp

http over zmq STREAM sockets. based on ideas from hintjens' web server.

other ideas are possible since protocol optimizations and transport design patterns of HTTP/2 standards track align well with the interface, namely:

Multiplexing of requests is achieved by having each HTTP request- response exchange associated with its own stream (Section 5). Streams are largely independent of each other, so a blocked or stalled request or response does not prevent progress on other streams. Flow control and prioritization ensure that it is possible to efficiently use multiplexed streams.

zttp ALPHA is an experimental, high performance http server

install

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

any libzmq after v4+ will work, but the RAW sockopt for connecting router socket types might be depricated

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);

});

test

$ git clone https://github.com/reqshark/zttp.git && cd zttp
$ npm install
$ npm test

MIT

Releases

No releases published

Packages

No packages published