AnswerDotAI / AnswerDotAI/fasthtml
[BUG] "WebSocket /live-reload" 403
- Dominant language
- Jupyter Notebook
- Stars
- 7k
- Forks
- 319
- Avg merge
- 28m
- Merged PRs (30d)
- 3
Description
**Describe the bug**
I ran an app (port 5001) with this `live=True` inside this line of code, and it worked fine, the terminal was fine too.
```python
app, rt = fast_app(live=True, debug=True, pico=False, hdrs=(frankenui, tailwind), before=bware)
```
Then I shut down the app (ctrl + c).
After that, I tried to run another different app (port 5001) that doesn't have `live=True`
```python
app, rt = fast_app(hdrs=base_hdrs + custom_styles)
```
I got this in my terminal, but the app works fine tho
```
INFO: 127.0.0.1:49494 - "WebSocket /live-reload" 403
INFO: connection rejected (403 Forbidden)
INFO: connection closed
INFO: 127.0.0.1:49496 - "WebSocket /live-reload" 403
INFO: connection rejected (403 Forbidden)
INFO: connection closed
INFO: 127.0.0.1:49498 - "WebSocket /live-reload" 403
INFO: connection rejected (403 Forbidden)
INFO: connection closed
```
If I run this using port 5002, no issue.
If I add `live=True` using port 5001, WebSocket got accepted.
```python
app, rt = fast_app(live=True, hdrs=base_hdrs + custom_styles)
```
Is there any way to stop this repeating message without having to use `live=True`?
**Environment Information**
Please provide the following version information:
- fastlite version: 0.2.0
- fastcore version: 1.8.4
- fasthtml version: 0.12.20
**Confirmation**
Please confirm the following:
- [x] I have read the FAQ (https://docs.fastht.ml/explains/faq.html)
- [x] I have provided a minimal reproducible example
- [x] I have included the versions of fastlite, fastcore, and fasthtml
- [x] I understand that this is a volunteer open source project with no commercial support.
**Screenshots**
Contributor guide
Research direction
Reproduce the issue on port 5001 by running the two shown fast_app configurations, then compare it with port 5002 and with live=True enabled. Start from the WebSocket /live-reload log behavior; done means the app without live=True no longer emits repeated 403 messages after the previous live-reload app is stopped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100