README: drop the CORS aside from Quick start, keep it where origins differ
The first-run step explained that the PWA and the API share an origin and no CORS/Private-Network-Access setup is involved - noise for the default setup, which always serves both from the same server. The line is gone (both languages), the Usage server intro no longer repeats it either, and the one place where it matters - the hosted PWA, which talks to a local server from another origin - now says so explicitly before the browser requirements.
This commit is contained in:
1 parent
9872913965
commit
6fbe57052f
2 files changed
+21
-24
No files matched your search
@@ -110,9 +110,7 @@ simtrace-analyser-server --capture gsmtap
|
|||||||
|
|
||||||
### First run
|
### First run
|
||||||
|
|
||||||
Open **http://127.0.0.1:8081/** — the PWA is served by the server, so the UI
|
Open **http://127.0.0.1:8081/** in a browser. `Ctrl+C` stops the server.
|
||||||
and the API share an origin (no CORS/Private-Network-Access setup). `Ctrl+C`
|
|
||||||
stops the server.
|
|
||||||
|
|
||||||
- `--capture gsmtap` (default) — listen for GSMTAP-SIM on UDP 4729, e.g. from
|
- `--capture gsmtap` (default) — listen for GSMTAP-SIM on UDP 4729, e.g. from
|
||||||
`simtrace2-pysniff` or `sigrok_iso7816_stream`;
|
`simtrace2-pysniff` or `sigrok_iso7816_stream`;
|
||||||
@@ -307,10 +305,9 @@ Server options:
|
|||||||
the installed package, or <repo>/frontend from source)
|
the installed package, or <repo>/frontend from source)
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open **http://127.0.0.1:8081/** in a browser — the PWA is served by the
|
Then open **http://127.0.0.1:8081/** in a browser. Use `--web-dir PATH` to
|
||||||
server, so the UI and the API share an origin and no CORS/Private-Network-Access
|
serve a different PWA directory (default: the bundled PWA, or
|
||||||
setup is involved. Use `--web-dir PATH` to serve a different PWA directory
|
`<repo>/frontend` in a source checkout).
|
||||||
(default: the bundled PWA, or `<repo>/frontend` in a source checkout).
|
|
||||||
|
|
||||||
### Hosted PWA (landing page)
|
### Hosted PWA (landing page)
|
||||||
|
|
||||||
@@ -318,13 +315,15 @@ A standalone copy of the PWA is hosted at **https://simtrace.atroshin.ru**.
|
|||||||
It is a pure frontend: point it (Settings → Server URL) at a locally running
|
It is a pure frontend: point it (Settings → Server URL) at a locally running
|
||||||
`simtrace-analyser-server`.
|
`simtrace-analyser-server`.
|
||||||
|
|
||||||
> **Browser restriction:** when the PWA is served from a public HTTPS host,
|
> **Browser restriction:** this is the one setup where the PWA and the API have
|
||||||
> reaching a local server (`http://127.0.0.1:8081`) requires two things: the
|
> different origins, so the browser applies CORS and Private Network Access
|
||||||
> server must send `Access-Control-Allow-Private-Network: true` (this server
|
> rules. Reaching a local server (`http://127.0.0.1:8081`) requires two
|
||||||
> does), and the browser must be allowed to access the local network — in
|
> things: the server must send `Access-Control-Allow-Private-Network: true`
|
||||||
> Chrome/Edge/Vivaldi: Site settings → Local network access → allow the site
|
> (this server does), and the browser must be allowed to access the local
|
||||||
> (or accept the permission prompt). Without the browser permission, the
|
> network — in Chrome/Edge/Vivaldi: Site settings → Local network access →
|
||||||
> request to `127.0.0.1` is blocked before any preflight is sent.
|
> allow the site (or accept the permission prompt). Without the browser
|
||||||
|
> permission, the request to `127.0.0.1` is blocked before any preflight is
|
||||||
|
> sent.
|
||||||
|
|
||||||
### Capture utility (`simtrace2-pysniff`)
|
### Capture utility (`simtrace2-pysniff`)
|
||||||
|
|
||||||
|
|||||||
+8
-10
@@ -111,9 +111,8 @@ simtrace-analyser-server --capture gsmtap
|
|||||||
|
|
||||||
### Первый запуск
|
### Первый запуск
|
||||||
|
|
||||||
Откройте **http://127.0.0.1:8081/** — PWA отдаёт сервер, поэтому интерфейс и
|
Откройте **http://127.0.0.1:8081/** в браузере. `Ctrl+C` останавливает
|
||||||
API находятся на одном origin (настройка CORS/Private-Network-Access не нужна).
|
сервер.
|
||||||
`Ctrl+C` останавливает сервер.
|
|
||||||
|
|
||||||
- `--capture gsmtap` (по умолчанию) — слушать GSMTAP-SIM на UDP 4729,
|
- `--capture gsmtap` (по умолчанию) — слушать GSMTAP-SIM на UDP 4729,
|
||||||
например от `simtrace2-pysniff` или `sigrok_iso7816_stream`;
|
например от `simtrace2-pysniff` или `sigrok_iso7816_stream`;
|
||||||
@@ -310,11 +309,9 @@ TS 51.011), поэтому FID, повторно используемый в р
|
|||||||
установленного пакета или <repo>/frontend при запуске из исходников)
|
установленного пакета или <repo>/frontend при запуске из исходников)
|
||||||
```
|
```
|
||||||
|
|
||||||
Затем откройте **http://127.0.0.1:8081/** в браузере — PWA отдаётся
|
Затем откройте **http://127.0.0.1:8081/** в браузере. Используйте
|
||||||
сервером, поэтому UI и API используют один origin, и настройка
|
`--web-dir PATH`, чтобы отдавать другой каталог PWA (по умолчанию: PWA внутри
|
||||||
CORS/Private-Network-Access не требуется. Используйте `--web-dir PATH`,
|
пакета или `<repo>/frontend` при запуске из исходников).
|
||||||
чтобы отдавать другой каталог PWA (по умолчанию: PWA внутри пакета или
|
|
||||||
`<repo>/frontend` при запуске из исходников).
|
|
||||||
|
|
||||||
### Размещённая PWA (лендинг)
|
### Размещённая PWA (лендинг)
|
||||||
|
|
||||||
@@ -322,8 +319,9 @@ CORS/Private-Network-Access не требуется. Используйте `--w
|
|||||||
Это чистый фронтенд: укажите в нём (Settings → Server URL) адрес
|
Это чистый фронтенд: укажите в нём (Settings → Server URL) адрес
|
||||||
локально запущенного `simtrace-analyser-server`.
|
локально запущенного `simtrace-analyser-server`.
|
||||||
|
|
||||||
> **Ограничение браузера:** когда PWA отдаётся с публичного HTTPS-хоста,
|
> **Ограничение браузера:** это единственная схема, где PWA и API находятся на
|
||||||
> доступ к локальному серверу (`http://127.0.0.1:8081`) требует двух
|
> разных origin, поэтому браузер применяет правила CORS и Private Network
|
||||||
|
> Access. Доступ к локальному серверу (`http://127.0.0.1:8081`) требует двух
|
||||||
> вещей: сервер должен отправлять
|
> вещей: сервер должен отправлять
|
||||||
> `Access-Control-Allow-Private-Network: true` (этот сервер отправляет),
|
> `Access-Control-Allow-Private-Network: true` (этот сервер отправляет),
|
||||||
> и браузер должен иметь разрешение на доступ к локальной сети —
|
> и браузер должен иметь разрешение на доступ к локальной сети —
|
||||||
|
|||||||
Reference in new issue
Block a user