How to organize the work of all components with socket.io? - socket.io

I have multiple socket.io components but I can only connect to one. How to be able to control socket.io from any component? Is it possible to connect it in Vuex? Or is it better not to?

Related

Is it possible to connect to Metatrader enabled forex without Metatrader client application?

Isn't it possible to connect to various forex brokers, using Metatrader 4/5 Api?
And I'm not talking about connecting to Metatrader client application, like this nodejs plugins allows https://github.com/PenguinTraders/MT4-Node.js/tree/master.
I'm talking about native connect - directly to forex Brooker, that has Metatrader enabled, so it's possible to make trader apps/robots in any language, like nodejs and ruby, and even hosted on servers?
I mean, can't one use fireshark, to find out the Api?
I think https://github.com/agiliumtrade-ai/metaapi-node.js-sdk is the kind of solution you are looking for. It allows use case exactly as you have described. You can implement a trading robot in node.js which communicates to MetaApi and MetaApi routes your requests to a MetaTrader broker.

How to use Pusher API for bi-directional communication?

When taking a look at the Pusher Servcer and their Client / Server API I am having some problems trying to figure out how Pusher will help me allow bi-directional communication between devices / apps.
I am having multiple smaller devices / apps in the field that should return their status to a server or another client, which acts as a dashboard to browse all those devices and monitor status, etc.
In my understanding this can be done using traditional WebSockets and a cloud-server in between which manages all connections between those clients - something I though Pusher would be.
But after reading through the docs I can't really see a concept of bi-directional data communication. Here's why:
To push data to the clients I have to use one of Pushers Server Libraries
To receive that Data I have to use one of Pusher Client Libraries
This concept however does not fit into what I need. I want to:
Broadcast to Clients.
Clients can send Data directly to Clients (Server acting as Gateway / Routing).
Clients can send Data to Server.
Server can send / response to unique Client.
When reading about Pusher, they state: "Bi-Directional Communication" which I currently cannot see. So how to implement that advertised Bi-Directional Communication?
Pusher does PubSub only. Using this, you can simulate bi-directional communication: Both sides of the conversation each need to have a topic dedicated to the conversation, and you then publish to this.
This is not ideal. For something which is probably closer to what you seem to want, take a look at WAMP (Web Application Messaging Protocol), which has more than just PubSub. There is a list of implementations at http://wamp-proto.org/implementations. For a router I would recommend Crossbar.io (http://crossbar.io), which has the most documentation to help you get started. Full disclosure: I am involved both with WAMP and Crossbar.io - but it's all open source and may just be what you need.

Downsides of using Autobahn as WAMP router?

I'm currently looking into using the WAMP-protocol to synchronise between server and clients of my future web-applications.
They recommend using crossbar.io as the router but since Autobahn supports all four roles (publisher, subscriber, caller, callee) itself I'm wondering why I would need another router framework like crossbar.io at all?
I'd like to use node.js with Autobahn|JS as the router and Autobahn|JS in the web-browser as the client. Is this feasible or am I missing something here?
Autobahn(JS/Python/CPP) supports all four client roles, but since WAMP is a routed protocol, you still need a WAMP router. Autobahn does not provide that, and there's now way in which you could use AutobahnJS to create a WAMP router on Node.js.
The WAMP router is not a framework - it's a component which you configure (authentication, authorization, transports etc.) and then just leave running. When everything is configured properly, this is completely transparent for your application.
I'm part of the Autobahn and Crossbar.io projects - so my recommendation is Crossbar.io, but there are other WAMP routers out there. These differ e.g. in regards to the amount of features they implement and their performance. As long as you don't rely on the features of a particular router, you can swap out the WAMP router at any time.

Is it possible to maintain multiple clients in NanoHttpd?

I am trying to build a simple server/client application where the NanoHttpd server communicates with the client using WebSockets.
The server replies back with the same text that the client sent.
Is it possible to broacast messages to all the clients connected?
Any links about Nanohttpd with multiple-clients connected would be helpful.
https://github.com/PathikDevani/NanoHttpd-Demo
check my github project. here some example for multi user handle on websocket.
-------link is broken now

Is it possible to use socket.io client-side with a custom C# web server?

related
I'm building a website where you can play games. When the player makes a move, I want to send that move to the server, then use C# to compute a response and return that back to the client. I'm fine with doing all the client-side stuff in JavaScript, I'm just trying to figure out how I should do the communication.
I was thinking about using socket.io, but I believe that requires me to write both the server and client in JS. So, I'm not sure what approach to take. Do I
try to get socket.io to communicate with a C# DLL, or do I
write the whole web-server in C# (should be relatively simple, no?). If so, can I still use socket.io client-side? It's just sending basic requests to the server, which I should be able to catch, no?
Or should I drop socket.io altogether, and just use jquery+ajax to send http requests to my server....but then how do I respond? Also, HTTP isn't as efficient/lightweight as sockets, is it?
I want to keep the communication as light as possible so that I can get fast response times and lighter server load.
Check out SignalR: https://github.com/SignalR/SignalR
It is sort of a socket.io port to ASP.NET (Which I'm assuming you will use for your webserver?)

Resources