-
Notifications
You must be signed in to change notification settings - Fork 196
Closed
Description
Unhandled Exception: FormatException: H
- server
import ws from 'ws';
const wsProt=3211;
const wsServer= new ws.Server({
port:wsProt,
host:'0.0.0.0'
},()=>console.log('WebSocketServer Run'));
wsServer.on('connection',(c)=>{
c.send('Hello');
// console.log(c);
});
- flutter
class _connect {
_connect(){
}
link(){
IO.Socket socket = IO.io('ws://172.16.5.10:3211',
IO.OptionBuilder()
.setTransports(['websocket']) // for Flutter or Dart VM
.setExtraHeaders({'foo': 'bar'}) // optional
.build());
socket.onConnect((_) {
print('connect');
socket.emit('msg', 'test');
});
socket.on('event', (data) => print(data));
socket.onDisconnect((_) => print('disconnect'));
socket.on('fromServer', (_) => print(_));
}
}
final Connect = _connect();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels