File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
5-network/12-server-sent-events Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -64,25 +64,25 @@ eventSource.onmessage = function(event) {
6464// или eventSource.addEventListener('message', ...)
6565```
6666
67- ### Cross-domain requests
67+ ### Кросс-доменные запросы
6868
69- ` EventSource ` supports cross-origin requests, like ` fetch ` any other networking methods. We can use any URL:
69+ ` EventSource ` , как и ` fetch ` , поддерживает кросс-доменные запросы. Мы можем использовать такой URL:
7070
7171``` js
7272let source = new EventSource (" https://another-site.com/events" );
7373```
7474
75- The remote server will get the ` Origin ` header and must respond with ` Access-Control-Allow-Origin ` to proceed .
75+ Сервер получит заголовок ` Origin ` и должен будет ответить с заголовком ` Access-Control-Allow-Origin ` .
7676
77- To pass credentials, we should set the additional option ` withCredentials ` , like this :
77+ Чтобы передать авторизирующие заголовки, нужно передать дополнительный аргумент ` withCredentials ` :
7878
7979``` js
8080let source = new EventSource (" https://another-site.com/events" , {
8181 withCredentials: true
8282});
8383```
8484
85- Please see the chapter < info:fetch-crossorigin > for more details about cross-domain headers .
85+ Более подробное описание кросс-доменных заголовков можете прочитать в главе < info:fetch-crossorigin > .
8686
8787
8888## Переподключение
You can’t perform that action at this time.
0 commit comments