npm package for signalr client not getting connected - javascript

Hi we need to run signalr client on console, are there any npm packages available.
i've already tried this https://www.npmjs.com/package/signalr-client but it is not getting connected to server HUB.

There is an issue under "Known Issues" title. "client.Proxy settings currently only work for HTTP and not HTTPS".
Alternatives
https://www.npmjs.com/package/signalrjs

Related

How to solve "Access-Control-Allow-Origin"-Issue in vue.js?

Im new to vue.js and webpack. I currently have a very big trouble to archive the next step: communicate with real-world-apis in a dev env.
what i currently do is:
npm run dev
my application calls an remote api to which i have no access.
then i run into the Access-Control-Allow-Origin-Issue.
If i build my application and run it with xampp everything works fine.
What can i do, to simply develope my application instead to hassle with that security thing?
I have tried to create a proxy, so i have already looked at:
npm cors (node-cors-client and node-cors-server) - but how does that apply to my vue app?
socket.io - but it seems to be overkill
http-server - but i got the same issues here
nuxt - could work, but then i need to refactor my vue.js app to nuxt and i dont know if this works then
any suggestions? Thanks!
Solved:
I ended up with a PHP-API
The PHP-API runs with xampp under port 80
The Vue.js-App runs with npm dev server under port 8080
The CORS-Hassle must solved then in the PHP-Script with:
https://stackoverflow.com/a/9866124/3918455

Feathers JS Client Timeout

I am sure this is something very simple, but for some reason I am getting a timeout when trying to integrate the feathersjs client with a very simple jQuery app. Files of interest are in src below. This repo only contains a single service "messages" connected to a NedB database with no authentication. When the script starts, I am attempting to add a single message to my messages service.
Repo:
https://github.com/Ryan8765/jquery-chat
Error in Console:
Uncaught (in promise) Error: Timeout of 5000ms exceeded calling create on messages
at client.js:66
The server side application has been created with an old (v2) version of the CLI but you are loading #feathersjs/feathers#^3.0.0 in the browser which uses a Socket.io message format that is not supported by a v2 server.
feathers --version on the command line should show 3.3.0 or later. You can either follow the migration guide to upgrade or install the latest #feathersjs/cli and regenerate the application.
Reference issue feathersjs/feathers#761.
I had the same issue using these package's on the client side with vue.js (vue#^3.2.16 and vite#2.6.4)
#feathersjs/feathers#^4.5.11
#feathersjs/socketio-client#^4.5.11
socket.io-client#^2.3.1
#feathersjs/authentication-client#^4.5.11
My issue was resolved after changing
import io from "socket.io-client";
to
import io from "socket.io-client/dist/socket.io";
in my client feathersjs settings

pusher without internet connection

I'm using laravel 5.4 with pusher to build a real-time application , but I have poor internet connection so I'm wondering if I can use a pusher bridge instead and if it doesn't need an internet connection ?
You need to configure another driver for Laravel because Pusher is a third-party service (needs internet), that manages all the web socket server. I also found out this behavior of Pusher and for that, I searched for another driver. Redis is the second option. Choosing Redis requires a Websocket server to be configured in order to manage all the connection (Pusher's tasks). This is because Redis only handles the sending of messages to the channels but doesn't do everything that Pusher does.
Install Predis on your Laravel project using this command composer require predis/predis.
Install Redis on your local server.
Then install this: https://github.com/tlaverdure/laravel-echo-server in order to install a socket.io server implementation compatible with Laravel. (Socket.io will be responsible now for managing the connections into the channels defined in Laravel).
Pusher requires an Internet connection to work unfortunately - however you should know that Pusher can deal with sketchy Internet connections fairly well, so you maybe could give it a try and see how well it works!

Kurento Media Server HelloWorld Javascript example webSocket error

Merry Christmas!
I am trying to configure KMS on my Ubuntu 14.04 (64 bit). I could install the KMS server successfully following the guide at https://www.kurento.org/docs/6.0.0/installation_guide.html.
Also, downloaded the Javascript HelloWorld tutorial from https://www.kurento.org/docs/6.0.0/tutorials/js/tutorial-1-helloworld.html. I could run the example successfully on localhost on Google Chrome Version 47.0.2526.106 (64-bit) on the same Ubuntu System.
But, I could not see the local video nor the loop backed video. Only a spinner icon is shown on both the Video placeholders. Consulting the Console log reveals a problem after creating the SDP offer. The error is as described below.
kurento-client.js:21072 WebSocket connection to 'wss://127.0.0.1:8433/kurento' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
I am no expert on web sockets and stuff. Any help on this would really help me to proceed forward.
Note: I am running the example on HTTP, not on HTTPS. I guess that would not be the cause of the problem, though.
Regards,
LazyCoder7
I managed to solve it. I was wrong on my guess though, HTTPS was indeed required in order to make the WebSocket connection ( i was not aware of that part ). Created a certificate file (.pem) (from crt and key file already in the helloworld folder) and configured the KMS server to use the certificate. After this I was able to see myself and the same me in loopback :)
You are following an old version of the documentation. Since Chrome 47, in is mandatory to server pages through HTTPS if you want to use the getUserMedia APi. So we updated all our tutorials, and they now have a self-signed certificate. In case of the JS tutorials, you also need to configure KMS to expose a secure WS signalling connection, as the browser directly connects to the media server to control it.
Please follow the latest version of the documentation here
Be sure that the KMS is running on the port 8433 (not 8888), if you are using docker
docker run -d --name kms -p 8433:8433 kurento/kurento-media-server:trusty-latest

Having problems running WebSocket for mqtt

I'm trying to replicate this demo
using my own mosquitto instance to control the meter. When I try to connect to "test.mosquitto.org", 8080 everything works great, but when I plug my own mqtt server's IP I receive: Connection failed: AMQJ0007E Socket error:undefined.
I believe this is due to the requirement of a websocket service to run on the same machine as the mqtt. The original author uses WSS, and I can't figure out how to install this service (complete noob). I Even tried to follow these directions with no luck Could anyone give some directions?
You can try Installing him HiveMQ while you wait for mosquito 1.4. That is a broker with websockets built in.
The easiest answer to this is probably to wait for Mosquitto v1.4 to ship which has baked in Websocket support.
If you can't wait for it to ship you can build from the development head stream which will get you what your looking for. You've not said what platform you are running the broker on, but these instructions should help on Linux: http://goochgooch.wordpress.com/2014/08/01/building-mosquitto-1-4/
Mosquitto v1.4 has been released on February 18th, 2015. It has inbuilt support for websockets.

Categories