What protocol is used when user is interacting with node-red dashboard - raspberry-pi

I am using MQTT and node red in a wireless plug project.
Question:
what is the protocol used when the user interface with the GUI (dashboard)?? when the user clicks on a switch or view the data published by mqtt on the webApp how this is internally handled ? through Web-sockets or what??

Assuming you are talking about the node-red-dashboard nodes.
Then the page is loaded via HTTP and the updates (both to and from) are sent via WebSockets using the socket.io library.
If you mean the Node-RED Editor (where flows are created/edited) then again the page is loaded over HTTP and the updates (the Node Status and the messages in the debug sidebar) are sent over a WebSocket connection.
Flow Deploys are sent as a HTTP POST

Related

NestJS Kafka send event from server to all clients

How do I send an event from the server to the client or to all clients? How do I get a server instance in the controller at all?
I need to send an event to the client from the server, without a request from the client side. The client listens, I send.
The point is that I implemented the architecture. Api-gateway sends a request to a microservice and gets a response. I need to implement sending event from microservice to api-gateway. In api-gateway I got a client instance in the controller, how do I get the same instance in the microservice? The controller in my microservice only listens to messages and sends a response. How can I do the same in api-gateway? So that Api-gateway listens to the event and microservice sends messages there.
It depends, altough you didn't provide enough details in your question, I'll pretend, based on your question tags, you're trying to use NestJS microservices and Kafka.
First of all, take a look at Nest's Microservices documentation, you should first understand how that works before trying to use it:
https://docs.nestjs.com/microservices/basics
You might also want to create a hybrid application if you're not going to exclusively use Kafka as an entrypoint:
https://docs.nestjs.com/faq/hybrid-application
That said, still based on your tags, here's a brief guide on how to implement Kafka on NestJS using the same knowledge you aquired reading about microservices and hybrid applications: https://docs.nestjs.com/microservices/kafka
You should be able to implement simple but functional application with those documentations I mentioned, but for anything else, you should provide more details on your question (like what you need, what you tried, some code etc).
Kafka send event ... To all clients
How do I send an event from the server
Kafka doesn't send. Clients poll.
If you deploy each Kafka consumer client application with a unique group.id, for the set of topics you're producing to, they will all uniquely consume the data. Otherwise, if each deployment shares a id, they all consume unique partitions of the topic, never getting the same event to all the clients
NestJS uses KafkaJS - https://kafka.js.org/docs/consuming
without a request from the client side
Unclear what this means. Even if the NestJS server is randomly generating data, you'll still need to use a Kafka producer client to send data to the Kafka server
get a server instance in the controller
The Kafka server? You wouldn't. You'd pass the bootstrap server string (via external config) into a producer or consumer instance, which then can be given to a controller

Initiating call and receiving call in web browser using freeswitch

I have a requirement, i have a web site in which i want to implement outgoing call and incoming call functionality. I am using freeswitch on windows as sip server, currently i am able to initiate call on local extensions using verto, how can i initiate outbound calls to mobile phone directly from browser and also able to receive the calls using browser.
Freeswitch has webrtc support, which means you can use SIP-webRTC client to register from browser and do IN/OUT calls.
SIP-webRTC client
Open source libs like JsSIP, sipJS, sipml5
SIP-Flash client
red5, flash phoner.
Paid libs which support both is Plivo,Twilio websdk.

mobicents can make a call but doesint show in server

hi following a tut at https://mobicents.ci.cloudbees.com/job/Mobicents-SipServlets-Release/lastSuccessfulBuild/artifact/documentation/html_single/index.html#getting-started-with-MSS-Tomcat-AS7 i can make a call between 2 sofphones which both say they have registered but in mobicents click2call server page no information is displayed and it states "No registered users. Please register at least two SIP User Agents." which couldint be the case if i can make and take calls anyone have any idea why this would happen.
By default Mobicents SIP Servlets uses the following application by default https://code.google.com/p/sipservlets/wiki/HTML5WebRTCVideoApplication
If you want to change the default application, go to the Mobicents SIP Servlets management console http://127.0.0.1:8080/sip-servlets-management and change the application routing so the default application that receives the INVITE and REGISTER. More on default application routing (DAR) management at https://mobicents.ci.cloudbees.com/job/Mobicents-SipServlets-Release/lastSuccessfulBuild/artifact/documentation/html_single/index.html#sssicar-SIP_Servlets_Server-Application-Router

Programmatically Call REST URL

Summary
Is there a way to programmatically call REST URLs setup in JBoss via RESTEasy so that the programmatic method call actually drills down through the REST processor to find/execute the correct endpoint?
Background
We have an application that has ~20 different REST endpoints and we have set the application up to receive data from other federated peers. To cut down on cross network HTML requests, the peer site sends a bulk of requests to the server, and the receiving server needs to act upon the URL it receives. Example data flow:
Server B --> [Bulk of requests sent via HTTP/Post] --> Server A breaks list down to individual URLs --> [Begin Processing]
The individual URLs are REST URLs that the receiving server is familiar with.
Possible Solutions
Have the receiving server read through the URLs it receives, and call the management beans directly
The downside here is that we have to write additional processing code to decode the URL strings that are received.
The upside to this approach is that there is no ambiguity as to what happens
Have the receiving server execute the URL on itself
The receiving server could reform the URL to be http://127.0.0.1:8080/rest/..., and make a HTTP request on itself.
The downside here is that the receiving server could have to make a lot of HTTP requests upon itself (it's already somewhat busy processing "real" requests from the outside world)
Preferred: Have the receiving server access the main RESTEasy bean somehow and feed it the request.
Sort of combo of 1 & 2, without the manual processing of 1 or the HTTP requests involved with 2.
Technology Stack
JBoss 6.0.0 AS (2010 release) / Java 6
RESTEasy

Is an API RESTful if it allows permanent requests (server push)

I am writing a REST API providing CRUD operations on resources.
I'd like the users to be able to register to some resources changes and get the updates via server push. For the server push I will provide support for reverse ajax, hidden iframe and websockets. In order to be as REST as possible I created a Streaming resource which handles the registrations and the connection to the client:
Streaming resource:
URI uri : A GET against this URI refreshes the client representation of the resources accessible to this user.
bool WebSocket : Indicate if websocket is available on this server
bool ReverseXHR : Indicate if ReverseXHR is available on this server
bool HiddenIframe : Indicate if HiddenIframe is available on this server
Registration[] Registrations : The set of registration tasks.
OpenChannel : Open streaming channel from webserver to client. GET parameter type=(websocket|xhr|hiddeniframe)
CloseChannel : Close streaming channel from webserver to client. GET parameter type=(websocket|xhr|hiddeniframe)
A call of openchannel?type=websocket would open the websocket and start streaming the data of the registered values.
I've read many articles but I am still a bit confused. Can I still call my API REST after doing this? And if no (or yes) why?
Thank you for your help!
Firstly, always implement what makes sense to solve the problem you face. Conforming to a given architectural style provides specific benefits but this should not exclude pragmatic solutions to a given problem.
But having said that, it seems like you're using streaming of resource data as a way to "tunnel" information back & forth between the client and the server. I'm pretty new to this but it seems to me that the tunneling data goes against the uniform interface constraint in the REST architectural style. Tunneling over HTTP is one of criticism level against soap based services.