Comments (2)
There were two options for sending responses with fasthttp until today:
- Via fasthttp.Server. The server automatically sends http response after user's code returns from the outer RequestHandler . See Server.serveConn implementation for details.
- Via Response.Write call. In this case the caller must call bufio.Writer.Flush in order to make sure the response is sent to the client.
After the commit f8c0d95 yet another approach has been appeared for sending responses - using Response.WriteTo.
from fasthttp.
Thank @valyala , fasthttp is owesome:) . I am writeing a http router(http reverse proxy) based on fasthttp, I modified some fasthttp code, so that I can copy response bytes from lower conn(proxy<-->backend server) to upper-conn(client <--> proxy) directly.
from fasthttp.
Related Issues (20)
- Feature request : update and show all examples for doing zero allocation when using fasthttp. 100% zero alloc for each req / resp. HOT 3
- It is not safe to read all stream body to memory without a max size limit. HOT 4
- serving a compress enabled public folder without +w permissions results in a 404 HOT 1
- no free connections available to host HOT 3
- when setting MaxConnsPerIP to value greater than zero, the TLSConnectionState( ) is null on a TLS connection returned from the worker pool. HOT 11
- invalid memory address or nil pointer dereference for firstByteReader'c HOT 2
- peeking nested query args HOT 1
- Incorrect Tag for version 1.54.0 HOT 1
- PFlag/Cobra compatibility in prefork HOT 1
- `\r` is improperly permitted in header names. HOT 1
- How to Optimize the Performance of My fasthttp Client in a Production Environment HOT 1
- `\r` and `\x00` are improperly permitted in header values HOT 1
- fasthttp.FS won't return Content-Encoding when files are too small HOT 4
- Empty header names are improperly permitted HOT 2
- How to get all custom headers of ResponseHeader and RequestHeader HOT 1
- FastHTTP doesn't adequately validate HTTP methods
- SetUserValue from array to map HOT 1
- Type mismatch in AppendUint HOT 9
- Fasthttp Client send multiple origin HOT 2
- FastHTTP doesn't strip tabs from header values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fasthttp.