zLeki / DxTrade-Api-Go

API for dxtrade that can be used with all golang applications to open, close, and manage positions with your dxtrade account. It works with all prop firms or companies that use dxtrade
MIT License
29 stars 5 forks source link

Cloudflare issue #6

Closed KingJune28 closed 2 months ago

KingJune28 commented 2 months ago
  1. WebSocket: bad handshake Error When trying to establish a WebSocket connection with the server, the connection fails, and the error message “websocket: bad handshake” is shown. It seems the HTTP upgrade request is not being handled properly by the server.
    1. Login Fails with 403 Forbidden During the login process, the API responds with a 403 Forbidden error, and the WebSocket connection terminates shortly after with a close 1000 (normal) message. Here are the headers for the request and response: Request Headers:
POST /api/auth/login HTTP/1.1
Host: dxtrade.ftmo.com
Accept-Encoding: gzip, deflate, br, zstd
Accept: */*
Content-Type: application/json
DNT: 1
Cookie: {JSESSIONID=xxxx; DXTFID=xxxx; __cf_bm=xxxx; cf_clearance=xxxx}

Expected Behavior:

1.  The WebSocket connection should succeed with the appropriate HTTP status code of 101 Switching Protocols.
2.  The login process should return a 200 OK with valid session cookies and proceed with further actions.

Actual Behavior:

1.  The WebSocket connection fails with the error websocket: bad handshake, which indicates that the handshake was not completed successfully.
2.  Login fails with a 403 Forbidden response, preventing further actions.
zLeki commented 2 months ago

So, unfortunately this issue is occurring because FTMO has re-enabled their Cloudflare again. The only thing I can recommend is to go back a couple versions on the main branch to find the Cloudflare bypass version, but it requires a Zen rows API key which they should still have a 14-day free trial then it's like 50$ a month. I wish there was an alternative to get around Cloudflare but there's nothing to my understanding.

zLeki commented 2 months ago

Here's the version