---
title: "Web Streams at the Edge"
description: "Deno Deploy supports the Web Streams standard, so a streaming, event-driven HTTP server can be written in a few lines of TypeScript."
url: "https://swe.quest/articles/web-streams-at-the-edge-9c3ab22babd10448"
canonical: "https://deno.com/blog/deploy-streams"
source: "Deno"
published: "2021-11-30"
difficulty: "medium"
kind: "How-to"
reading_minutes: 3
tags: ["javascript","serverless","realtime","typescript"]
---

# Web Streams at the Edge

A post on [Deno](https://swe.quest/sources/deno.md), published 2021-11-30, 3 min read, How-to. Original: [https://deno.com/blog/deploy-streams](https://deno.com/blog/deploy-streams)

## Summary

Deno Deploy supports the Web Streams standard, so a streaming, event-driven HTTP server can be written in a few lines of TypeScript. Code examples cover an unbuffered HTTP proxy that passes request bodies straight through, a proxy that uppercases response text chunk by chunk with TransformStream, TextDecoderStream and TextEncoderStream, Server-Sent Events built from ReadableStream and setInterval with cleanup on cancel, and WebSockets via Deno.upgradeWebSocket. Because Deno Deploy serves over HTTP/2, SSE avoids the six-connection-per-host browser limit that makes it a poor fit on HTTP/1.1.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- JavaScript async/await ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- HTTP basics
- Fetch API

## Keywords

Deno Deploy, Web Streams, TransformStream, Server-Sent Events, WebSockets, HTTP/2

## Related posts

- [Deno 1.35: A fast and convenient way to build web servers](https://swe.quest/articles/deno-1-35-a-fast-and-convenient-way-to-build-web-servers-4272182679c6d67c.md): Deno · 2023-07-05 · Medium · 5 min read · JavaScript, TypeScript, Runtimes & VMs, Performance engineering
  Deno.serve() is now stable, replacing the connection-iterator Deno.serveHttp() pattern with a one-line handler built on web-standard Request and Response objects.
- [Deno 1.9 Release Notes](https://swe.quest/articles/deno-1-9-release-notes-9464f1a005df95e7.md): Deno · 2021-04-13 · Medium · 8 min read · Runtimes & VMs, JavaScript, TypeScript, Performance engineering, Networking
  Deno 1.9 adds a native HTTP/2 server API (Deno.serveHttp) built on Hyper, which raises hello-world throughput by 48% over the pure-TypeScript std/http server and reuses fetch's Request/Response objects.
- [A Whole Website in a Single JavaScript File](https://swe.quest/articles/a-whole-website-in-a-single-javascript-file-71d46431d0988f5b.md): Deno · 2022-04-05 · Medium · 2 min read · JavaScript, Serverless, CDN & edge, Frontend, TypeScript
  A demo multi-page website fits entirely in one JavaScript file and is server-rendered on demand at the edge with Deno.
- [Deno 1.12 Release Notes](https://swe.quest/articles/deno-1-12-release-notes-2fc6918341f284d0.md): Deno · 2021-07-13 · Medium · 12 min read · JavaScript, Runtimes & VMs, WebAssembly, TypeScript
  Deno 1.12 adds Web Crypto key generation, signing and verification, server-side WebSocket upgrades via Deno.upgradeWebSocket on the unstable native HTTP server, and TypeScript transpilation plus automatic static-to-dynamic import conversion in the REPL.
- [Deno 1.13 Release Notes](https://swe.quest/articles/deno-1-13-release-notes-83ca2c6bd96b58db.md): Deno · 2021-08-10 · Medium · 12 min read · JavaScript, Runtimes & VMs, TypeScript
  Deno 1.13 stabilizes the native HTTP server API (Deno.serveHttp, built on Hyper and dogfooded on deno.land), adds synchronous self.structuredClone() for deep cloning with circular references, and lets TLS trust the system CA store via DENO\_TLS\_CA\_STORE=system, alongside a dangerous --unsafely-ignore-certificate-errors flag.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
