admin管理员组文章数量:1434908
Well, I am trying to connect to this websocket ws://rustypot/socket.io/?EIO=4&transport=websocket but keep getting 403 forbidden error. I tried both connecting using my NodeJS backend and Postman with the same result. So, when you encounter such a problem, the first thing you're supposed to do is to check the headers and I did. All my headers are fine:
Error: Unexpected server response: 403
Handshake Details
Request URL: .io/?EIO=4&transport=websocket
Request Method: GET
Status Code: 403 Forbidden
Request Headers
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: HeibSZt/sW4ivlyCkdN87g==
Connection: Upgrade
Upgrade: websocket
Origin:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Host: rustypot
Response Headers
Date: Sun, 26 Jun 2022 14:48:11 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
CF-Chl-Bypass: 1
Permissions-Policy: accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()
Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires: Thu, 01 Jan 1970 00:00:01 GMT
X-Frame-Options: SAMEORIGIN
Expect-CT: max-age=604800, report-uri=";
Server: cloudflare
CF-RAY: 7216be129b0484b0-LED
BUT if I try to connect to the same damn websocket via some chrome extension it works fine:
Any help would be much appreciated. Is Cloudflare kicking my ass? I'm so confused
本文标签:
版权声明:本文标题:javascript - Websocket keeps responding with "403 Forbidden" despite ALL the headers ARE correct - Stack Overf 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745636734a2667605.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论