Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http codec #523

Merged
merged 15 commits into from Nov 11, 2014
Merged

Http codec #523

merged 15 commits into from Nov 11, 2014

Conversation

creationix
Copy link
Member

This adds an implementation of the http core protocol for server and client, encoding and decoding. Included is a unit test for the codec, a sample clustering http server and a sample http client.

@imzyxwvu
Copy link

imzyxwvu commented Nov 9, 2014

Why not http_parser?

@creationix
Copy link
Member Author

I'm trying to minimize the number of C bindings we depend on. Luvit itself is not allowed to have any C bindings to simplify the build process. All bindings are restricted to the luvi layer and I want luvi to be as minimal as possible. If there was an existing high-quality implementation of tls in lua, I would have used that instead of openssl bindings. Same for zlib stuff. But HTTP is pretty trivial (relatively) to implement in pure lua and still has great performance (I'm getting around 100k reqs/second with this branch on my laptop). Also this new http implementation is platform and stream agnostic so it could be easily adapted into other lua frameworks.

@creationix
Copy link
Member Author

Also having as much as possible in the luvit layer makes it easier for people to customize their own project. It keeps things on a level playing field and makes it trivial to add http2 as a pure-lua pull-request should someone want to do that.

One of the main goals with luvit 2.0 (the luvi-up branch) is to make contribution and customization more approachable. I want people with only experience in scripting languages and no C compiler installed on their system to be able to create their own custom luvit-like binaries with their own custom lua libraries.

@@ -0,0 +1,44 @@
local uv = require('uv')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this out of the root directory?

@rphillips
Copy link
Member

+1 after the nits.

creationix added a commit that referenced this pull request Nov 11, 2014
@creationix creationix merged commit 18800c4 into luvi-up Nov 11, 2014
@rphillips rphillips deleted the http-codec branch November 18, 2014 02:38
zhaozg pushed a commit to zhaozg/luvit that referenced this pull request Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants