Coder Social home page Coder Social logo

mitol's People

Contributors

askuzminov avatar helidium avatar markobiskup avatar udivankin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mitol's Issues

'../src/Server.h' file not found

npm install produces:

In file included from ../mns.cc:1:
../http.h:10:10: fatal error: '../src/Server.h' file not found
#include "../src/Server.h"
         ^

npm: v4.6.1
node: v6.11.1

Why error benchmark When using express or kao

express.js
`const express = require('express');
const app = express()
const http = require('mitol');

app.get('/', (req, res) => {
res.send('Hello World!');
});

http.createServer(app).listen(3000, () => {
console.log('Example app listening on port 3000!');
});`

kao.js
`const mitol = require('mitol');
const Koa = require('koa');
const app = new Koa();

// response
app.use(ctx => {
ctx.status = 200;
ctx.body = 'Hello World!';
});

mitol.createServer(app.callback()).listen(3000);`

wrk -t12 -c400 -d3s http://127.0.0.1:3000/

Running 3s test @ http://127.0.0.1:3000/
12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 0.00us 0.00us 0.00us -nan%
Req/Sec 0.00 0.00 0.00 -nan%
0 requests in 3.10s, 0.00B read
Socket errors: connect 0, read 15897, write 0, timeout 0
Requests/sec: 0.00
Transfer/sec: 0.00B

if use sametime morgan for express error Cannot read property 'remoteAddress' of undefined

im trying mitol with express but if using morgan logger express try remote access or something here error report:
Cannot read property 'remoteAddress' of undefined

TypeError: Cannot read property 'remoteAddress' of undefined
at forwarded (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/forwarded/index.js:31:35)
at alladdrs (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/proxy-addr/index.js:57:15)
at proxyaddr (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/proxy-addr/index.js:231:15)
at IncomingMessage.ip (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/express/lib/request.js:351:10)
at getip (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/morgan/index.js:466:14)
at logger (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/morgan/index.js:107:26)
at Layer.handle [as handle_request] (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/express/lib/router/index.js:317:13)
at /mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/mnt/c/Users/x0nim/Desktop/workspace/avukat-node/node_modules/express/lib/router/index.js:335:12)

mitol does not play nice with http-proxy. missing pipe?

โžœ  cache-proxy-service node index.js   
Example app listening on port 8080!
TypeError: (options.buffer || req).pipe is not a function
    at Array.stream (/home/stephen/dev/cache-proxy-service/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:161:29)
    at ProxyServer.<anonymous> (/home/stephen/dev/cache-proxy-service/node_modules/http-proxy/lib/http-proxy/index.js:80:21)
    at redis.get.then (/home/stephen/dev/cache-proxy-service/index.js:31:13)
    at tryCatcher (/home/stephen/dev/cache-proxy-service/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/stephen/dev/cache-proxy-service/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/stephen/dev/cache-proxy-service/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/stephen/dev/cache-proxy-service/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/stephen/dev/cache-proxy-service/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/home/stephen/dev/cache-proxy-service/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/stephen/dev/cache-proxy-service/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/home/stephen/dev/cache-proxy-service/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

Roadmap?

Is there an effort being made on this project still?

I'd like to see a roadmap, basically a list of features that the http module has that mitol will eventually implement. The roadmap should go in the README.md file.

Also, a list of quirks where mitol differs from the http module would be much appreciated. This list would not include missing features, since that's what the roadmap is for.

This will help users understand where the project is lacking, and maybe even inspire more contributors.

Thanks!

NPM?

Hi there! Would love to try this out in real products, but realistically, it would only be feasible if I could load this in via npm.

Is there any way that this is possible?

FWIW, as of writing this, the name mitol is available.

Causes Segmentation Fault under heavy load

In most cases even 'hello world' server quits with segfault when trying to reach smth like 2k rps on linux.
Output on mac differs a bit, returning malloc and/or 100% CPU.

req.on('data'...) does not seem to work

Tried to make "hello world" post/put request handler but it does not seem to work (while GET does work as expected)

Here's the code:

const http = require('mitol');

let server = http.createServer((req, res) => {
  if (req.method === 'GET') {
    res.end('Hello World!'); // works as expected
    return;
  }

  var str = '';
  req.on('data', function(data){
    str += data;
  });
  req.on('end', function(){
    res.end('POST pingback', str);  // never fires
  });
});
 
server.listen(8099, () => {
    console.log('Example app listening on port 8099!')
});

Request->url immutable

Various libraries (including) express modify the value of the URL (e.g for serving sub apps). This is incompatible with mitol as the field is implemented as a const char

Can't write 400 status code

Here's the code:

const http = require('mitol');

let server = http.createServer((req, res) => {
    res.statusCode = 400;
    res.end();
});
 
server.listen(8099, () => {
    console.log('Example app listening on port 8099!')
});

Nothing is returned in response (lets say timeout).
When trying to set e.g statusCode = 404, it works as expected.

Koa compatibility?

I'm running an ultra simple server with koa and I'm seeing this

  TypeError: x.ee.removeListener is not a function
      at cleanup (/Users/omni/Documents/git/drive-proxy/node_modules/ee-first/index.js:62:12)
      at callback (/Users/omni/Documents/git/drive-proxy/node_modules/ee-first/index.js:54:5)
      at onevent (/Users/omni/Documents/git/drive-proxy/node_modules/ee-first/index.js:93:5)
      at respond (/Users/omni/Documents/git/drive-proxy/node_modules/koa/lib/application.js:229:43)
      at handleResponse (/Users/omni/Documents/git/drive-proxy/node_modules/koa/lib/application.js:134:36)
      at <anonymous>

fish: 'node index' terminated by signal SIGSEGV (Address boundary error)

Here is what I'm running

const mitol = require('mitol');
const Koa = require('koa');
const app = new Koa();

// response
app.use(ctx => {
  ctx.status = 200;
  ctx.body = 'Hello';
});

mitol.createServer(app.callback()).listen(3000);

This works without fail when I'm using http as normal

no package.json

npm install https://github.com/Helidium/Mitol.git won't work because you don't have a package.json in the repo

Support for connection

As per #15 currently request.connection is missing. This breaks logging middleware in express (e.g morgan) as well as some authentication solutions.

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.