ibraheemdev / astra Goto Github PK
View Code? Open in Web Editor NEWRust web servers without async/await.
License: MIT License
Rust web servers without async/await.
License: MIT License
Along with the overall lack of integration tests, some of the utilities Body::wrap_stream
, BodyReader
would benefit from unit tests.
I'm in the process of migrating some code from using tiny_http
to astra
, but there's one piece of functionality I've been relying upon (mainly for logging) that I don't think astra
supports at the moment: getting the client address of a request.
In tiny_http
, that's provided by its Request
type remote_addr(), and plain hyper
gives access to it through MakeService
(see this commit).
I'd imagine this would require a breaking change to astra::Service
to accept a second argument or an entirely new type of Request
. I'm happy to push a PR if this sounds like a good idea.
Hi!
In my free time I wanted to play with htmx in Rust, which turned out into usual spare-time yak-shaving, trying to glue together some personal "web stack".
I'm somewhat of an "async-sceptic" - in a sense that I believe that in its current form async brings more pain than benefit for majority of projects.
So for web server I seem to have two choices: there's rouille and now there's astra. I used rouille before, for similar reasons, it was OK. But I like astra's hyper-based yet-blocking model, and so far it feels kind nice to work with.
As I'm playing with different functionality, I feel some pain points. E.g. I now want to handle sessions, deal with cookies, possibly forms, etc. Hyper itself does not seem to help much with these.
So I wonder - if astra planning to remain rather bare minimum wrapper around hyper, or is the a room for some "conveniences" like cookie and form parsing, and possibly others - either directly, or in some companion/recommended libraries?
Do you have any plans already or are you satisfied with the current state?
Upgrade to Hyper 1.0, look into what extra features we can implement now (timers, etc.).
This project looks very interesting; I'm writing a CLI app that needs to serve one single request (for OAuth), and in principle I'd like to avoid having to spin up Tokio and go full async just for that, and Astra fits the bill. But of course I must have TLS, and whereas for a normal server I'd just use a reverse proxy I can't do that here. Would you be willing to offer built-in TLS?
Line 149 in 53ad085
Service
already requires Send + Sync + 'static
so it's rather pointless. Instead S: Service + Clone
, and the user can Arc
(or not) the S
internally.
In my case I need to use Arc
internally in my code (because reasons), and now it will be effectively Arc<Arc<Stuff>>
and it can't be avoided, so my inner micro-optimizator is bothering me.
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.