question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connect to websocket under cloudflare causes 403 forbidden error

See original GitHub issue
  • I’ve searched for any related issues and avoided creating a duplicate issue.

Description

I am trying to connect to websocket under cloudflare, and it refuse connection with 403 forbidden error.

When I am trying this in node.js, connection refused with 403 code.

new WebSocket('wss://live-arena-rjsqbe.agar.io/?party_id=GPUBAM', [], {
            headers: {
                Accept: `*/*`,
                "Accept-Encoding": `gzip, deflate, br`,
                "Accept-Language": `en-GB,en;q=0.5`,
                "Cache-Control": `no-cache`,
                Connection: `keep-alive, Upgrade`,
                ... More headers here ...
            },
        })
        "websocket": "^1.0.34",
        "ws": "^7.1.2",
        "wss": "^3.3.4"

When I am trying to connect to websocket in this way from browser, it works fine.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
lpincacommented, Feb 21, 2022

You can try to shuffle the default ciphers. See https://httptoolkit.tech/blog/tls-fingerprinting-node-js/.

0reactions
iocmetcommented, Jun 27, 2022

How to fix it? I have same problem and I’m also trying to connect to wss://live-arena-XXXXXX.agar.io:443…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloudflare NRT region WebSocket 403 error (error code: 1034 ...
This problem is not caused by my source server, this problem has ... Connection: Upgrade Upgrade: websocket Sec-WebSocket-Version: 13 ...
Read more >
How to Fix Error 403 Forbidden on Cloudflare - Web Pop
The Cloudflare 403 forbidden error is super annoying. It may result from changes or updates that your hosting company made in their system...
Read more >
Cant connect websocket behind cloudflare · Issue #489 - GitHub
I am trying to connect to the websocket, unfortunately i am ... Here is the 403 Forbidden i receive from cloudflare with the...
Read more >
How to fix Cloudflare 403 forbidden error | 24/7 Server Support
The reason to cause the Cloudflare 403 is due to Ip block, faulty rules set in. htaccess file, cache etc.the error must be...
Read more >
How do I troubleshoot HTTP 403 errors from API Gateway?
If the error was reported in a web browser, then that error might be caused by an incorrect proxy setting. The proxy server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found