-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cannot connect to rippled WebSocket API using Dart client. #22
Comments
There were a few minor issues with how we check for the end of the HTTP headers that were causing this error. Those are fixed with commit e310b49. Next, websocketpp wouldn't accept an "upgrade" header, which is what Dart sends. It insists on "Upgrade". That is also fixed with the same commit. However, we're still dead in the water because of this issue: "Short Key 3: A0 A3 7F 46 8E 7F bytes missing: 8 eofbit: true failbit: true badbit: false goodbit: false Possible solutions include:
|
Since this library is included in the SDK, it's highly unlikely that anyone will come up with an alternative. |
Fixed with commit 986cce6 |
rippled.cfg:
...
[websocket_ip]
127.0.0.1
[websocket_port]
6006
...
$ ./rippled --net
Dart code:
WebSocket.connect('ws://127.0.0.1:6006').then((WebSocket socket) {
print('Connected');
socket.listen((message) {
print(message);
},
onDone: () {
});
socket.send('{"command":"subscribe","id":0,"streams":["server", "ledger", "transactions"]}');
});
Expected:
Dart should start receiving streaming data.
Actual:
print('Connected') is not called. Interestingly if I shutdown rippled while keeping the Dart client running I get:
Uncaught Error: HttpParserException: Connection closed before full header was received
Unhandled exception:
HttpParserException: Connection closed before full header was received
#0 _FutureImpl._scheduleUnhandledError. (dart:async:349:9)
#1 Timer.run. (dart:async:2251:21)
#2 Timer.run. (dart:async:2258:13)
#3 Timer.Timer. (dart:async-patch:9:15)
#4 _Timer._createTimerHandler._handleTimeout (dart:io:5987:28)
#5 _Timer._createTimerHandler._handleTimeout (dart:io:5995:7)
#6 _Timer._createTimerHandler. (dart:io:6003:23)
#7 _ReceivePortImpl._handleMessage (dart:isolate-patch:40:92)
The text was updated successfully, but these errors were encountered: