JavaScript/websocket/socket.io:修订间差异
来自康健生活
| 第217行: | 第217行: | ||
</syntaxhighlight></tab> | </syntaxhighlight></tab> | ||
</tabs>}} | </tabs>}} | ||
== nginx == | |||
<pre> | |||
location /socket.io/ { | |||
proxy_pass http://127.0.0.1:8080; | |||
proxy_set_header Upgrade $http_upgrade; | |||
proxy_set_header Connection "upgrade"; | |||
proxy_http_version 1.1; | |||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |||
proxy_set_header Host $host; | |||
}</pre> | |||
== other == | == other == | ||
* https://socket.io/docs/v4/handling-cors/ | * https://socket.io/docs/v4/handling-cors/ | ||