# @libp2p/http-websocket

> libp2p-compatible implementation of the WebSocket API

Latest version **2.0.4** (published 2026-07-03) · Apache-2.0 OR MIT license · 0 weekly downloads

## Install

```sh
npm install @libp2p/http-websocket
pnpm add @libp2p/http-websocket
yarn add @libp2p/http-websocket
bun add @libp2p/http-websocket
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2026-07-03 |
| First published | 2025-05-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 OR MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 10 |
| Unpacked size | 677.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13 |
| Maintainers | daviddias, alanshaw, achingbrain, vascosantos, npm-service-account-libp2p, jacobheun |

## Links

- npm: https://www.npmjs.com/package/@libp2p/http-websocket
- Repository: https://github.com/libp2p/js-libp2p-http
- Homepage: https://github.com/libp2p/js-libp2p-http/tree/main/packages/http-websocket#readme
- Issues: https://github.com/libp2p/js-libp2p-http/issues
- npm.io page: https://npm.io/package/@libp2p/http-websocket

## Dependencies (10)

- [race-event](https://npm.io/package/race-event.md) ^1.6.1
- [uint8arrays](https://npm.io/package/uint8arrays.md) ^6.1.1
- [multiformats](https://npm.io/package/multiformats.md) ^14.0.0
- [@libp2p/utils](https://npm.io/package/@libp2p/utils.md) ^7.0.15
- [uint8arraylist](https://npm.io/package/uint8arraylist.md) ^3.0.2
- [@libp2p/interface](https://npm.io/package/@libp2p/interface.md) ^3.2.0
- [@libp2p/http-utils](https://npm.io/package/@libp2p/http-utils.md) ^2.0.0
- [@multiformats/multiaddr](https://npm.io/package/@multiformats/multiaddr.md) ^13.0.3
- [@libp2p/interface-internal](https://npm.io/package/@libp2p/interface-internal.md) ^3.1.0
- [@achingbrain/http-parser-js](https://npm.io/package/@achingbrain/http-parser-js.md) ^0.5.9

## Recent versions

- 2.0.4 (latest) — 2026-07-03
- 2.0.3 — 2026-06-14
- 2.0.2 — 2026-04-28
- 2.0.1 — 2025-10-13
- 2.0.0 — 2025-10-02
- 1.0.1 — 2025-05-28
- 1.0.0 — 2025-05-28
- 0.0.0 — 2025-05-28

## README

# @libp2p/http-client

# @libp2p/http-websocket

[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-http.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-http)
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-http/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/libp2p/js-libp2p-http/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> libp2p-compatible implementation of the WebSocket API

# About

<!--

!IMPORTANT!

Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.

To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts

To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.

-->

This is an implementation of the [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
that uses libp2p streams as the underlying transport layer, instead of a TCP
socket.

# Install

```console
$ npm i @libp2p/http-websocket
```

## Browser `<script>` tag

Loading this module through a script tag will make its exports available as `Libp2pHttpWebsocket` in the global namespace.

```html
<script src="https://unpkg.com/@libp2p/http-websocket/dist/index.min.js"></script>
```

# API Docs

- <https://libp2p.github.io/js-libp2p-http/modules/_libp2p_http-websocket.html>

# License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](https://github.com/libp2p/js-libp2p-http/blob/main/packages/http-websocket/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](https://github.com/libp2p/js-libp2p-http/blob/main/packages/http-websocket/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

# Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

---
_Source: https://npm.io/package/@libp2p/http-websocket · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
