https://github.com/tomphttp/bare-server-worker
TompHTTP Bare server in the Cloudflare Worker runtime
https://github.com/tomphttp/bare-server-worker
cloudflare-worker proxy serviceworker tomphttp worker
Last synced: 4 months ago
JSON representation
TompHTTP Bare server in the Cloudflare Worker runtime
- Host: GitHub
- URL: https://github.com/tomphttp/bare-server-worker
- Owner: tomphttp
- License: gpl-3.0
- Created: 2022-12-10T21:58:12.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-05T18:28:48.000Z (about 2 years ago)
- Last Synced: 2023-03-04T17:08:19.964Z (about 2 years ago)
- Topics: cloudflare-worker, proxy, serviceworker, tomphttp, worker
- Language: TypeScript
- Homepage:
- Size: 417 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TOMP Bare Server
This repository implements the TompHTTP bare server. See the specification [here](https://github.com/tomphttp/specifications/blob/master/BareServer.md).
## Workers
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.
## Who this is for
This port requires some technical knowledge (Cloudflare KV, Workers). You will have to modify some code in order to get it working.
## Quickstart
1. Clone this repository
```sh
git clone https://github.com/tomphttp/bare-server-worker.git
```2. Install
```sh
npm install
```3. Build
```sh
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.