frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The Anti-Bot Technique: Cooperative Rendering with Blazeio

1•anonyxbiz•3mo ago
The Discovery

While working with Blazeio (a Python async web framework with true zero-buffering streaming), I stumbled upon this technique - and it's so stupidly effective it feels like cheating.

The magic code: ``` import Blazeio as io import Blazeio.Other.proxy as proxy import Blazeio.Modules.onrender as onrender

io.INBOUND_CHUNK_SIZE, io.OUTBOUND_CHUNK_SIZE = 1024100, 1024100

io.Scope.add_imports(globals())

io.Scope.web = io.App("0.0.0.0", 9001, with_keepalive = 1)

class Element: __slots__ = ("r", "element", "className") def __init__(app, r: io.BlazeioProtocol, element: str, className: str = None): app.r, app.element, app.className = r, element.encode(), b'class="%b"' % className.encode() if className else b''

    async def __aenter__(app):
        await app.r.write(b'<%b %b>' % (app.element, app.className))
        return app

    async def __aexit__(app, *args):
        await app.r.write(b'</%b>' % app.element)
        return False

    async def text(app, text: str):
        return await app.r.write(text.encode())
class Dom: __slots__ = ("r", "event", "id") def __init__(app, r: io.BlazeioProtocol): app.r = r app.event = io.SharpEvent() app.id = io.token_urlsafe(11)

    async def __aenter__(app):
        await app.r.write(b'<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width, initial-scale=1.0">\n<title>Dynamic Rendering</title>\n<link rel="stylesheet" href="/get/favicon?id=%b" fetchpriority="high">\n</head>\n<body>\n' % app.id.encode())
        return app

    async def __aexit__(app, *args):
        await app.r.write(b'\n</body>\n</html>')
        return False
    
    def __await__(app):
        yield from app.event.wait_clear().__await__()
        return app
    
    def element(app, *args, **kwargs):
        return Element(app.r, *args, **kwargs)
@io.Scope.web.attach class Main: __slots__ = () events = io.ddict() def __init__(app): ...

    async def _get_favicon(app, r: io.BlazeioProtocol):
        if not (dom := app.events.pop(r.params().get("id"), None)): raise io.Abort("Not found", 404)
        dom.event.set()
        await io.Deliver.text("True")

    async def _(app, r: io.BlazeioProtocol):
        await r.prepare({"Content-type": "text/html", "Transfer-encoding": "chunked"}, 200)

        async with Dom(r) as dom:
            app.events[dom.id] = dom
            await dom

            async with dom.element("main") as element:
                await element.text("Hello world")
if __name__ == "__main__": with io.Scope.web: io.Scope.web.runner() ```

How It Works

For Real Browsers:

1. Browser requests / 2. Server streams: <!DOCTYPE...<link rel="stylesheet" href="/get/favicon?id=UNIQUE_ID"> 3. Browser naturally fetches the "stylesheet" (actually our trigger endpoint) 4. Server receives the trigger request and continues rendering: <main>Hello world</main> 5. User sees complete page

For Bots:

1. Bot requests / 2. Server streams: <!DOCTYPE...<link rel="stylesheet" href="/get/favicon?id=UNIQUE_ID"> 3. Bot doesn't fetch the "stylesheet" (or fetches it too late) 4. Server stops rendering at <body> 5. Bot sees incomplete page and gives up

Comments

gus_massa•3mo ago
Rememeber to add two spaces to get into code mode

  import Blazeio as io
  import Blazeio.Other.proxy as proxy
  import Blazeio.Modules.onrender as onrender

Velocity of Money

https://en.wikipedia.org/wiki/Velocity_of_money
1•gurjeet•52s ago•0 comments

Stop building automations. Start running your business

https://www.fluxtopus.com/automate-your-business
1•valboa•5m ago•1 comments

You can't QA your way to the frontier

https://www.scorecard.io/blog/you-cant-qa-your-way-to-the-frontier
1•gk1•6m ago•0 comments

Show HN: PalettePoint – AI color palette generator from text or images

https://palettepoint.com
1•latentio•6m ago•0 comments

Robust and Interactable World Models in Computer Vision [video]

https://www.youtube.com/watch?v=9B4kkaGOozA
1•Anon84•10m ago•0 comments

Nestlé couldn't crack Japan's coffee market.Then they hired a child psychologist

https://twitter.com/BigBrainMkting/status/2019792335509541220
1•rmason•12m ago•0 comments

Notes for February 2-7

https://taoofmac.com/space/notes/2026/02/07/2000
2•rcarmo•13m ago•0 comments

Study confirms experience beats youthful enthusiasm

https://www.theregister.com/2026/02/07/boomers_vs_zoomers_workplace/
2•Willingham•20m ago•0 comments

The Big Hunger by Walter J Miller, Jr. (1952)

https://lauriepenny.substack.com/p/the-big-hunger
1•shervinafshar•21m ago•0 comments

The Genus Amanita

https://www.mushroomexpert.com/amanita.html
1•rolph•26m ago•0 comments

We have broken SHA-1 in practice

https://shattered.io/
7•mooreds•27m ago•2 comments

Ask HN: Was my first management job bad, or is this what management is like?

1•Buttons840•28m ago•0 comments

Ask HN: How to Reduce Time Spent Crimping?

2•pinkmuffinere•29m ago•0 comments

KV Cache Transform Coding for Compact Storage in LLM Inference

https://arxiv.org/abs/2511.01815
1•walterbell•34m ago•0 comments

A quantitative, multimodal wearable bioelectronic device for stress assessment

https://www.nature.com/articles/s41467-025-67747-9
1•PaulHoule•36m ago•0 comments

Why Big Tech Is Throwing Cash into India in Quest for AI Supremacy

https://www.wsj.com/world/india/why-big-tech-is-throwing-cash-into-india-in-quest-for-ai-supremac...
1•saikatsg•36m ago•0 comments

How to shoot yourself in the foot – 2026 edition

https://github.com/aweussom/HowToShootYourselfInTheFoot
1•aweussom•36m ago•0 comments

Eight More Months of Agents

https://crawshaw.io/blog/eight-more-months-of-agents
4•archb•38m ago•0 comments

From Human Thought to Machine Coordination

https://www.psychologytoday.com/us/blog/the-digital-self/202602/from-human-thought-to-machine-coo...
1•walterbell•38m ago•0 comments

The new X API pricing must be a joke

https://developer.x.com/
1•danver0•39m ago•0 comments

Show HN: RMA Dashboard fast SAST results for monorepos (SARIF and triage)

https://rma-dashboard.bukhari-kibuka7.workers.dev/
1•bumahkib7•40m ago•0 comments

Show HN: Source code graphRAG for Java/Kotlin development based on jQAssistant

https://github.com/2015xli/jqassistant-graph-rag
1•artigent•45m ago•0 comments

Python Only Has One Real Competitor

https://mccue.dev/pages/2-6-26-python-competitor
4•dragandj•46m ago•0 comments

Tmux to Zellij (and Back)

https://www.mauriciopoppe.com/notes/tmux-to-zellij/
1•maurizzzio•47m ago•1 comments

Ask HN: How are you using specialized agents to accelerate your work?

1•otterley•48m ago•0 comments

Passing user_id through 6 services? OTel Baggage fixes this

https://signoz.io/blog/otel-baggage/
1•pranay01•49m ago•0 comments

DavMail Pop/IMAP/SMTP/Caldav/Carddav/LDAP Exchange Gateway

https://davmail.sourceforge.net/
1•todsacerdoti•50m ago•0 comments

Visual data modelling in the browser (open source)

https://github.com/sqlmodel/sqlmodel
1•Sean766•52m ago•0 comments

Show HN: Tharos – CLI to find and autofix security bugs using local LLMs

https://github.com/chinonsochikelue/tharos
1•fluantix•52m ago•0 comments

Oddly Simple GUI Programs

https://simonsafar.com/2024/win32_lights/
1•MaximilianEmel•53m ago•0 comments