> For the complete documentation index, see [llms.txt](https://esmp-fun.gitbook.io/plugins/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://esmp-fun.gitbook.io/plugins/markdown-guide/reference/run-it-yourself.md).

# Run the editor yourself

You don't need to: the editor and its relays at `esmp.fun` are free to use. This page is for anyone who would rather their pages never leave machines of their own.

## What the three parts do

| Part             | What it does                                                          | Setting                 |
| ---------------- | --------------------------------------------------------------------- | ----------------------- |
| The editor       | A web page that edits your guide                                      | `web-editor.url`        |
| The relay        | Holds your pages for the editor, and the changes on the way back      | `web-editor.relay-url`  |
| The socket relay | Passes the live preview and saving between the editor and your server | `web-editor.socket-url` |

Your server and the browser both reach out to the relays, so neither has to be reachable by the other.

## The relays

Both are lucko's open source programs, unchanged:

* the relay is [bytebin](https://github.com/lucko/bytebin)
* the socket relay is [bytesocks](https://github.com/lucko/bytesocks)

Run each behind a web server with HTTPS, and point the two settings at them. The socket relay needs WebSockets to pass through. Messages up to 128 KB must get through it, which a preview of a long page needs.

## The editor

The editor is a plain web page, built from the `editor/` folder of this plugin's source:

```bash
cd editor
npm install
npm run build
```

Host the `dist/` folder anywhere that serves `/edit/<anything>` as its `index.html`, and point `web-editor.url` at it, ending in `/edit/`.

The editor fetches your pages from `bin.esmp.fun` unless its address says otherwise: links made by your server name your own relay, as `/edit/<code>?relay=https://your.relay/`.

{% hint style="info" %}
Anyone holding an editor link can read that guide's text while the link works. Every message on the live link is signed, so the relays can carry them but can't change them, and your server acts only on a browser its owner has trusted in game.
{% endhint %}
