Flutter implementing socket.io with dart - websocket

i am trying to implement socket.io with my flutter app, currently flutter is supporting WebSocket but i have found a way for socket.io in package "dart.io" but i am unable to understand how to emit a message on a specific event. Any suggestions would be helpful :)

I have ported socket.io in dart code since 2017, and it can work with flutter as well in the same codebase - socket.io-client-dart and socket.io-dart.

Using this flutter_socket_io package, I managed to connect to my local Socket IO server.
SocketIO socket = SocketIOManager().createSocketIO("http://localhost:3000", "/");
socket.init();
socket.connect();
Maybe you could share your implementation on both client and server side to debug further.

I think you looking for this flutter_socket_io

Related

How can you use a WebSocket client in a Flutter app?

Is there a way to open a WebSocket client in a Flutter app? Flutter doesn't allow you to import dart:html, which is the normal way of using a WebSocket client.
In Flutter you can use dart:io which supports WebSocket
https://api.dartlang.org/stable/1.24.2/dart-io/WebSocket-class.html

how can i use socket.io client for phoenix framework chat app

I want to know is there are any way to use socket.io client for phoenix framework chat app .without using default socket.js client.i am change nodejs chat app to phoenix framework but i want to keep my old front-end client .that's why i want to figure out way to use socket.io client with phoenix framework.
let socket = new Socket("/socket", {params: {user: user, status: status }})
socket.connect()
seems like its not possible:
You cannot use another client like socket.io, because Phoenix channels and socketio use different messaging protocols. My recommendation is so use the phoenix.js client and continue to build great things with it :)
source: https://groups.google.com/forum/#!topic/phoenix-talk/aRnVOkc0sgs

Haxe and Socket.IO for web & mobile

We have a game that is written with Adobe Flash and the server side is NodeJS and they communicate with socket.io.
We consider moving to Haxe, the problem is that when I try to google for Haxe and socket.io, I only find indications for it to operate together using haxe-js-kit.
Does anyone have any experience with Haxe and Socket.IO?
How is the performance of using haxe-js-kit for socket.io support?
Can I use haxe-js-kit both on browser and mobile and it will work properly?
Any information regarding the issue would be greatly appreciated!
Following twitter there are a fresh socket.io externs
For experience/recommendations go to haxe group
There are probably no pure Haxe port of Socket.io. If you intent on using it for OpenFL/Kha/etc. you'll want to port a Flash library to Haxe.

HoloLens websockets

I'm trying to program a websocket client for the HoloLens using System.Net.Sockets;.
It works in Unity but when I try to build it for the HoloLens I get errors like:
Socket does not contain a definition of Connect
The websocket libraries for Unity also don't work.
How can I create a websocket client for the HoloLens?
I believe you will need to use websockets for UWP for the hololens and use System.Net.Sockets for the Unity Editor and wrap the UWP code in NETFX_CORE or WINDOWS_UWP define.
You could use WWW unity object to send and receive http requests/answers! I had no problem connecting with http protocol with the hololens using this.

How can I serve the socket.io client JavaScript along with my other JS libraries

I understand that the socket.io JavaScript client file will be served from the Node.js server, but this is not good because I've used some sort of JavaScript library dependency manager like require.js or steal.js.
I wish I could serve the socket.io client JavaScript file from my main (static assets) server, not from Node.js server. Is this doable? And how can I achieve this?
Socket.io is already useable from a client, and although on the server-side it's usually used with node.js, there is no reason you can't use it from another Javascript library. It has no node.js dependencies I'm aware of.
According to the documentation is how you server socket.io to client.
As far as I know you cannot serve socket.io like node does to the client from outside node server.
Please do correct me if i'm wrong
Hope this helps
The easiest way is to include the socket.io client JavaScript library from CDNJS:
<script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js"><script>

Resources