I have written (stolen) a simple stand-alone WebSocket client that works fine when connecting to e.g. ws://
demos.kaazing.com/echo, but when I try to connect to a local WebSocket server written i Pony, I get this:
Unhandled exception:
#0 _HttpParser._doParse (dart:io/http_parser.dart:428)
#1 _HttpParser._parse (dart:io/http_parser.dart:318)
#2 _HttpParser._onData (dart:io/http_parser.dart:804)
My Dart progam looks like this:
import "dart:io";
void receivedData(data) {
print("Received: $data");
}
main() async {
socket.listen((data) {
receivedData(data);
});
for (int i=1; i<4; i++) {
socket.add("dart-$i");
}
}
I have reported the problem to the developer of the Pony WebSocket library, here: