relay over ws supossedly working
This commit is contained in:
105
QUICKSTART.md
105
QUICKSTART.md
@@ -135,6 +135,13 @@ Via public hostname with relay (works from behind NAT, WSL2, 5G — no `--advert
|
||||
.\.venv\Scripts\meshnet-node.exe start --tracker https://ai.neuron.d-popov.com --model Qwen/Qwen2.5-0.5B-Instruct
|
||||
```
|
||||
|
||||
WSL (same relay path — no `--advertise-host`):
|
||||
|
||||
```bash
|
||||
.venv/bin/meshnet-node start --tracker https://ai.neuron.d-popov.com --model Qwen/Qwen2.5-0.5B-Instruct
|
||||
.venv/bin/meshnet-node start --tracker http://192.168.0.179:8081 --model Qwen/Qwen2.5-0.5B-Instruct
|
||||
```
|
||||
|
||||
`--host 0.0.0.0` binds the node to all Windows interfaces. `--advertise-host`
|
||||
is what the tracker gives to other nodes for direct connections; omit it when using
|
||||
the relay path since all traffic flows through the relay tunnel instead.
|
||||
@@ -176,26 +183,114 @@ Client → HTTPS → ai.neuron.d-popov.com (nginx)
|
||||
└─ /rpc/* → meshnet-relay :8765 (caller opens WS per hop)
|
||||
```
|
||||
|
||||
### Start the relay and tracker (server side)
|
||||
### Nginx Proxy Manager (Docker)
|
||||
|
||||
Use **one** proxy host for the domain. Do not create a second host for the same
|
||||
domain to reach another port — path routing is done with **Custom locations** on
|
||||
that same host.
|
||||
|
||||
**1. Details tab** (default `/` → tracker)
|
||||
|
||||
| Field | Value |
|
||||
|-------|--------|
|
||||
| Domain Names | `ai.neuron.d-popov.com` |
|
||||
| Scheme | `http` |
|
||||
| Forward Hostname / IP | LAN IP of the tracker machine (e.g. `192.168.0.179`) |
|
||||
| Forward Port | `8081` |
|
||||
| Websockets Support | ON |
|
||||
|
||||
This serves `/v1/network/map`, `/v1/chat/completions`, and the rest of the tracker API.
|
||||
|
||||
**2. Custom locations tab** (sub-paths → relay)
|
||||
|
||||
The Custom locations form has **no separate Websockets toggle** — only location,
|
||||
scheme, forward host, optional sub-folder path, and port. Add **two** locations
|
||||
(both pointing at the relay process on port `8765`). Leave **“Add a path for
|
||||
sub-folder forwarding”** empty so the full URI reaches the relay
|
||||
(`/ws`, `/rpc/<peer_id>`).
|
||||
|
||||
Location A — persistent node connections:
|
||||
|
||||
| Field | Value |
|
||||
|-------|--------|
|
||||
| Define location | `/ws` |
|
||||
| Scheme | `http` |
|
||||
| Forward Hostname / IP | `192.168.0.179` |
|
||||
| Forward Port | `8765` |
|
||||
| Sub-folder path | *(leave empty)* |
|
||||
|
||||
Location B — per-hop RPC:
|
||||
|
||||
| Field | Value |
|
||||
|-------|--------|
|
||||
| Define location | `/rpc` |
|
||||
| Scheme | `http` |
|
||||
| Forward Hostname / IP | `192.168.0.179` |
|
||||
| Forward Port | `8765` |
|
||||
| Sub-folder path | *(leave empty)* |
|
||||
|
||||
Nginx matches the longer prefixes first: `/ws` and `/rpc/…` go to relay; everything
|
||||
else stays on `8081`.
|
||||
|
||||
**3. SSL tab**
|
||||
|
||||
Use your existing Let’s Encrypt certificate (unchanged).
|
||||
|
||||
**4. Advanced tab** (only if WebSocket upgrade fails on `/ws` or `/rpc`)
|
||||
|
||||
Custom locations do not expose a Websockets checkbox. If nodes show
|
||||
`Relay configured but not connected yet` while `/v1/network/map` works, add this
|
||||
snippet on the **proxy host** Advanced tab:
|
||||
|
||||
```nginx
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
```
|
||||
|
||||
**5. Verify routing**
|
||||
|
||||
```bash
|
||||
# Terminal 1 — relay (WebSocket hub)
|
||||
# Tracker (8081 via default location)
|
||||
curl -s https://ai.neuron.d-popov.com/v1/network/map | python3 -m json.tool
|
||||
|
||||
# Relay paths should not 502/404 from the tracker — check response headers/status
|
||||
curl -sI https://ai.neuron.d-popov.com/ws
|
||||
curl -sI https://ai.neuron.d-popov.com/rpc/test-peer
|
||||
```
|
||||
|
||||
After NPM is correct, start relay and tracker on the LAN machine:
|
||||
|
||||
```bash
|
||||
# Terminal 1 — relay
|
||||
.venv/bin/meshnet-relay --host 0.0.0.0 --port 8765
|
||||
|
||||
# Terminal 2 — tracker (advertises relay URL to nodes)
|
||||
# Terminal 2 — tracker (advertises relay to nodes)
|
||||
.venv/bin/meshnet-tracker start \
|
||||
--host 0.0.0.0 \
|
||||
--port 8081 \
|
||||
--relay-url wss://ai.neuron.d-popov.com/ws
|
||||
```
|
||||
|
||||
Nodes using `https://ai.neuron.d-popov.com` should then log:
|
||||
|
||||
```text
|
||||
Relay advertised by tracker — using outbound tunnel wss://ai.neuron.d-popov.com/ws
|
||||
Relay connected — wss://ai.neuron.d-popov.com/rpc/<peer_id>
|
||||
```
|
||||
|
||||
The `--relay-url` flag embeds the relay address in `/v1/network/map`. Every node
|
||||
queries that endpoint on startup and auto-connects if a relay URL is present.
|
||||
|
||||
### Start a node (any machine, any network)
|
||||
|
||||
No `--advertise-host` needed. The node discovers the relay URL from the tracker
|
||||
and opens a persistent outbound WebSocket:
|
||||
No `--advertise-host`, firewall rule, port forwarding, relay URL, or peer URL is
|
||||
needed on the node. The public tracker is the only bootstrap URL the user types.
|
||||
The node queries the tracker for `/v1/network/map`, discovers the relay URL, and
|
||||
opens a persistent outbound WebSocket. If the relay connection drops, the node
|
||||
keeps retrying it.
|
||||
|
||||
```bash
|
||||
.venv/bin/meshnet-node start \
|
||||
|
||||
Reference in New Issue
Block a user