之前尤其是配置nginx代理webSocket的时候,老是不能确定到底有没有配置对,能不能连接上
现在后了有这个测试工具,就可以比较方便的知道自己的配置对不对了.
比如:有这样一个webSocket地址我们开发的:
ws://172.19.126.198:8888/myWebSocket
nginx配置:
server {
listen 9010;
server_name localhost;
location / {
root /data/front/web/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /prod-api/ {
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
proxy_set_header X-forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://172.19.126.223:8080/;
}
location /ws {
proxy_pass http://172.19.126.223:8