This repository implements the TompHTTP bare server. See the specification here.
WebSocket proxying is now fully supported since the previous effort to port the Bare server. This implementation uses KVNamespaces in order to store stateful WebSocket data.
Currently, the namespace name is BARE
. Any non-JSON strings in the KV namespace will cause the script to break.
This port requires some technical knowledge (Cloudflare KV, Workers). You will have to modify some code in order to get it working.
- Clone this repository
git clone https://github.com/tomphttp/bare-server-worker.git
- Install
npm install
- Build
npm run build
Output will contain:
- dist/sw.js - All-in-one service worker. Automatically creates the Bare Server.
- dist/index.js - ESM library. For use in environments where scripts can be imported.