Comments (4)
the source code for 1.5 is on the gofiber branch. Sadly gofiber doesnt support streaming, hence files will first be fully downloaded into the proxys ram, causing crashes if the files are too big
I have been debating if i want to port the changes i made in 1.5 to the main branch too but since they're pretty major and i havent really actively been working on this, i havent done so yet
Ill look into the iframe stuff, tho it's always worked for me
from balooproxy.
Ah! I did not realize that streaming was not supported, that makes sense! How unfortunate though.
Oddly enough, I overlooked the multiple branches.
"Fiber/Fasthttp supports response streaming to the client using the SetBodyStreamWriter"
to stream response, you will need create a new fasthttp Response and pass it to fasthttp.Client in the
proxy middleware and pipe new reponse's body to fiber.Ctx's response (newResponse.BodyWriteTo(*fiber.Ctx)
or use the SetBodyStreamWritter with a buffer).
But currently, proxy middleware only use the response of fiber.Ctx (c.Response()),
so with proxy middleware, you can neither do stream proxy, nor modify/multiplying stream body.
You will have to use you own http.Client or fasthttp.Client to send requests.
Thanks for specifying, given that, I probably would hold off on porting the changes.
I like both, 1.5 definitely has a performance boost and consumes less resources but given that's at the expense of site functionality-- I'm not sure if it's worth it.
Is there anything alternative to http/gofiber, seperate to that, are there other potentials that you've had ideas for, to increasing the ability to handle requests at a lower resource cost?
With my test, 1.4, it consumed nearly all resources 20-30k R/S (none bypassed) and though it is a weaker CPU, it consumed all CPU at even less.
I'm just trying to see what optimizations can be done for those worst case scenarios.
I also may implement functionality to cut off acceptance of any new requests, or kill the existing highest resource consuming requests, once RAM hits a certain utilization percentage, to prevent baloo from outright being killed.(Like with the 1.5 issue)
I'm not familiar but it sounds like -- it could be worth while to switch from http to fasthttp, though I'm not sure at the moment. Any insights into limitations, problems or reasons why it may not work? I may try it out if I have the time
(That is, if the root issue of streaming can be worked around -- sounds like it may be able to, just not with gofiber)
I'm using Firefox, the only reason I knew that the iframe wasn't showing due to the contents not being encoded was from a past project where I ran into the same issue.
from balooproxy.
https://github.com/41Baloo/balooProxy/tree/merge-gofiber-improvements (soon to be merged into main)
should now have the improvements of the gofiber branch. Sadly it's not possible to support streaming with gofiber, as it's only able to stream data itself but will still have to first download the stream from the backend completely (AFAIK)
from balooproxy.
Merged into main now
from balooproxy.
Related Issues (20)
- Bunny.net CDN HOT 1
- Crashes When Streaming Big Media HOT 1
- A suggestion HOT 1
- Smarting Ratelimiting & HTTPs Support HOT 3
- Discord Firewall rule not working / not applying HOT 5
- Not Working HOT 11
- 520 error when pending file upload request HOT 6
- Discord Alerts HOT 4
- A suggestion about logs HOT 1
- goFiber Alerts HOT 1
- enhancement: Some enhancement for balooproxy HOT 1
- how to install? HOT 2
- I'm getting: invalid IP address HOT 1
- Contact
- abuseipdb integration HOT 1
- No readme pictures HOT 1
- Balooproxy whitelist firewall rules aren't taking effect HOT 1
- Pre-release version - Killed HOT 2
- weird logs, is this mean got bypassed? HOT 2
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 balooproxy.