dart-lang / dart-lang/http

Header Error => Connection closed before full header was received.

Open
#1,596 6 comments 0 reactions 0 assignees View on GitHub
package:web_socket_channel
Dominant language
Dart
Stars
1.1k
Forks
419
Avg merge
4d 14h
Merged PRs (30d)
8

Description

How to fix the error?

I have been used The Library => **web_socket_channel: ^1.0.12** ([Library Link](https://pub.dartlang.org/packages/web_socket_channel#-readme-tab-))

Error Output
> WebSocketChannelException: WebSocketChannelException: HttpException: Connection closed before full header was received, uri = http://192.168.1.106

My Socket Code
```
WebSocketChannel channel = **IOWebSocketChannel.connect("ws://192.168.1.106:80");**

channel.stream.listen(
(data) {
print("Socket: data => " + data.toString());
},
onError: (error) {
print("Socket: error => " + error.toString());
},
onDone: () {
print("Socket: done");
},
);
```
This way I am sending a message.
```
channel.sink.add(/*data*/);
```
Where is my mistake?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.