nipsuli / unisonhttp Goto Github PK
View Code? Open in Web Editor NEWWIP: unison http implementation
License: MIT License
WIP: unison http implementation
License: MIT License
Here's some of my ideas what I'd like to do before tagging this library with any version, now I just push everything to the master, so not giving any guarantees on stability. After these changes I'm planning to be good citizen and follow semantic versioning :)
So to the point. Basically this library consists of two parts: 1. talking with socket, and 2. parsing Bytes
to HttpRequest
and HttpResponse
objects and converting those back to bytes.
Currently the parser first parses Bytes
first into Text
and then does the HTTP parsing, while this was good approach for practising how to write HTTP parser, it's IMO bit limiting, e.g. in case of returning a file from disk as a response. Thus I was thinking on changing body
in the HttpResponse
and HttpRequest
to be Bytes
instead of Optional Text
.
Then naturally we can implement on top of that something like TextResponse
and HttpRequest.bodyText
. But the underlying data structures would contain body
as Bytes
.
I guess after spending time reading RFC 2616
and implementing the text parsing of this, I guess this shouldn't be too hard. Just need to reimplement fromBytes
and toBytes
to handle bytes directly.
As the basic objects will change, this will be breaking change and main thing I want to build before tagging this to any versioning.
Another thing that I've been thinking is to implement multi threaded server, so that main thread would only wait in io.accept
and when connection is created pass that socket to thread to handle the rest. But as this is more just new feature instead of breaking change like the HttpRequest
HttpResponse
I might leave that out from this iteration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.