http-over-websocket
v0.0.4
Published
A protocol that has HTTP/2-ish semantics to multiplex HTTP over a single WebSocket connection
Maintainers
Readme
hows-ts
This is the TypeScript implementation of HTTP-over-WebSocket (HoWS).
It currently implements a browser-compatible client that exposes a
fetch-compatible API that can be used anywhere fetch
is supported, including by patching window.fetch.
Get it:
npm install http-over-websocketUse it:
import { Hows } from 'http-over-websocket'
const hows = new Hows('ws://example.com/compat/hows')
const response = await hows.fetch('/api/info.json')
if (response.ok) {
const json = await response.json()
} else {
alert(`Got status: ${response.status} ${response.statusText}`)
}
