Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code not working #3

Closed
Troodi opened this issue Jul 31, 2020 · 4 comments
Closed

Example code not working #3

Troodi opened this issue Jul 31, 2020 · 4 comments

Comments

@Troodi
Copy link

Troodi commented Jul 31, 2020

PHP 7.3
Sample code not work on dev-master
socket error: Unable to read from stream: stream_get_contents(): SSL:

With real API

$config = new \FxcmRest\Config([
  'host' => 'api.fxcm.com',
  'token' => '***',
]);

With demo API
Uncaught Error: Class 'FxcmRest\Exception' not found in E:\OSpanel\domains\TradingView\vendor\fxcm\fxcmrest\src\SocketIO.php:169

$config = new \FxcmRest\Config([
  'host' => 'api-demo.fxcm.com',
  'token' => '***',
]);

In SocketIO class in wsdata method i get $packet:

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
@fxcm-dhalpert
Copy link

please replace line 84 in Socketio.php file with this line:

$request = "GET /socket.io/?EIO=3&transport=websocket&sid={$this->options->sid}&access_token={$this->config->token()} HTTP/1.1\r\n"

@Troodi
Copy link
Author

Troodi commented Aug 3, 2020

please replace line 84 in Socketio.php file with this line:

$request = "GET /socket.io/?EIO=3&transport=websocket&sid={$this->options->sid}&access_token={$this->config->token()} HTTP/1.1\r\n"

Thank you!

@Troodi Troodi closed this as completed Aug 3, 2020
@johndkn
Copy link

johndkn commented Jan 11, 2021

Hello,
Would it be possible to update the repository with this change?
Thanks in advance

@PlanetTheCloud
Copy link
Contributor

This issue has delayed our projects by a few days as we thought it was our server that was rejected by Cloudflare (as it was working a few hours prior).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants