title: How can i use sockets with Flutter web
body: <p>I'm trying to make a connection between a socket server written in Python using <code>socketio</code> to a client made with Flutter Web.</p>
  
  <p>I tested various socket packages like <a href="https://pub.dev/packages/adhara_socket_io" rel="nofollow noreferrer">adhara_socket_io</a> and <a href="https://pub.dev/packages/flutter_socket_io" rel="nofollow noreferrer">flutter_socket_io</a> and nothing worked. I tried the same code snippets on Android and they didn't work too.</p>
  
  <p>I kept searching and i found this code snippet. It uses the <code>Socket</code> class from the <code>dart.io</code> package.</p>
  
  <pre><code>Socket socket = await Socket.connect('192.168.2.190', 7003);
  
      print('connected');
  
      // listen to the received data event stream
      socket.listen((List&lt;int&gt; event) {
        print(utf8.decode(event));
      });
  
      // send hello
      socket.add(utf8.encode('hello'));
  
      // wait 5 seconds
      await Future.delayed(Duration(seconds: 5));
  
      // .. and close the socket
      socket.close();
  </code></pre>
  
  <p>This one connected to the Python server and sent the data from Android but when i tested it from Web i didn't connect.</p>
  
  <p>Is there some things extra i need to add for it to work on Web?</p>
  
  <p>Or in the worst case, is there another way to do what i want to do, my goal is to display a video feed in a website. The video is actually a bunch of images taken from Python, there is some machine learning that will be performed on them and i want to send them over socket and each image is displaying as soon as it is received so it looks like a video feed. (Similar thing was done using React)</p>