1.先查是否開啟了socket端口
2.需要配置 你得nginx
ws://域名/wss(可自定義)文章來源:http://www.zghlxwxcb.cn/news/detail-713987.html
nginx 配置文章來源地址http://www.zghlxwxcb.cn/news/detail-713987.html
location /wss(可自定義 必須 和上面一直)/ {
proxy_pass http://127.0.0.1:9404/; #通過配置端口指向部署websocker的項(xiàng)目
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
到了這里,關(guān)于WebSocket connection to failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!