1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
[Read Me](README.md) > FAQ
Getting error:
Run `rws` with administrator privileges (`sudo` on Linux/macOS, run as Administrator on Windows).
Getting error:
Another process is already using that port. Find and stop it:
```bash
sudo lsof -i :7878 # macOS and Linux
sudo fuser 7878/tcp # Linux only
```
Started `rws` on `127.0.0.1` but cannot reach it from other devices on the local network.
`127.0.0.1` is the loopback address — it only accepts connections from the same machine. Start `rws` bound to the machine's network IP or `0.0.0.0`:
```bash
rws --ip=0.0.0.0
```
Getting error in the console:
The server received a request that is not valid UTF-8. This can happen when a client sends binary data or when a browser connects via HTTP to an HTTPS-only server. Safe to ignore.
Getting error in the console:
The server received a malformed or unexpected request (e.g. a port scanner or protocol mismatch). Safe to ignore.
Getting error on Linux:
The IP address you specified is not assigned to any local interface. Use `ip addr` to list available addresses.
How do I start the server on IPv6?
```bash
rws --ip=::
```
Started with `--ip=::` but cannot connect via `fe80::...` link-local address.
Use the interface's `inet` (IPv4) address instead. It will be mapped internally to `[::ffff:192.168.x.y]`.
Trying to open a directory URL gets a _404 Not Found_ error.
Directory listing is intentionally not supported (a security decision). Create an `index.html` file in the directory, or link to the files explicitly in an HTML page.
Cannot connect to server:
A firewall is likely blocking the port. Temporarily disable the firewall and retry.
Cannot start server as root:
`/usr/local/bin` or `~/.cargo/bin` is not in root's `$PATH`. Use the full path:
```bash
sudo /usr/local/bin/rws
sudo ~/.cargo/bin/rws
```
Build fails with:
Install the C development toolchain:
```bash
sudo apt-get install build-essential # Debian/Ubuntu
sudo dnf group install "Development Tools" # Fedora/RHEL
sudo pacman -S base-devel # Arch Linux
```
Build fails in IDE with:
```bash
cargo clean
cargo build
```
Build fails with registry lock error:
```bash
sudo cargo clean
sudo cargo build
```
Getting error when pulling sources:
```bash
rm Cargo.lock
```
It will be regenerated on the next build.
Why do some methods start with `_`?
Rust warns about unused items. The leading underscore suppresses that warning for intentionally kept-but-unused public API methods.
How do I view server logs over HTTP?
Redirect stdout to a file and serve it:
```bash
rws &> out.txt &
```
Then open `http://hostname:port/out.txt`. The file grows over time; watch its size.
Started `rws` but HTTPS / HTTP/2 / HTTP/3 is not working.
No TLS certificate is configured. Provide certificate and key paths:
```bash
rws --tls-cert-file=/path/to/cert.pem --tls-key-file=/path/to/key.pem
```
Without a certificate the server falls back to plain HTTP/1.1 automatically. See [CONFIGURE](CONFIGURE.md) for all configuration options.
Getting a TLS error on startup:
The certificate or key file path is wrong or the process does not have read permission. Verify the paths and permissions. Both files must be in PEM format.
Browser shows a security warning when connecting to the local HTTPS server.
Self-signed certificates are not trusted by browsers by default. For local development, add the certificate to your system trust store. For production, use a certificate from [Let's Encrypt](https://letsencrypt.org/).
Kubernetes liveness or readiness probe is failing with _Connection refused_.
The default bind IP is `0.0.0.0` since v17.5.0, so new deployments should work out of the box. If you are running an older version or have overridden the IP to `127.0.0.1`, the kubelet cannot reach the pod IP. Set the bind address explicitly:
```bash
rws --ip=0.0.0.0
```
Or in `rws.config.toml`:
```toml
ip = '0.0.0.0'
```
Kubernetes readiness probe returns _503 Service Unavailable_ immediately after the pod starts.
This is expected — `GET /readyz` returns `503` until the server finishes startup, then switches to `200 OK`. If it stays at `503`, the server failed to start (check logs). Add `initialDelaySeconds` to give the process time to initialize:
```yaml
readinessProbe:
httpGet:
initialDelaySeconds: 5
periodSeconds: 5
```
Logs are in JSON format but I want the classic Combined Log Format.
Set `RWS_CONFIG_LOG_FORMAT=combined` (or `log_format = 'combined'` in `rws.config.toml`). JSON is the default since v17.5.0.
How do I scrape Prometheus metrics from `rws`?
`GET /metrics` returns counters and a gauge in Prometheus text format. Point your scrape config at the server:
```yaml
scrape_configs:
- -