Questions tagged [sails.io.js]
JavaScript SDK for communicating w/ Sails via sockets from Node.js or the browser.
91
questions
0
votes
0
answers
36
views
Sails: io.socket.get requests are throwing 401 Unauthorized
I recently upgraded the version of Sails from version 1.5.2 to 1.5.7 for Vulnerability Fix.
This is my first time working with sails and node. So, there are lots of gaps in my understanding.
After the ...
-2
votes
1
answer
50
views
Every time i create new sails project and try to log in this error will come help me with this plz
enter image description here
CloudError: Endpoint (`observeMySession`) responded with an error (or the request failed).
I need to fix this error this is my browser console error and those come while ...
0
votes
1
answer
65
views
sails.io.js with Svelte3/4 SvelteKit
I've been trying to port my app from older Svelte3/Rollup to newer Vite based setup and am having trouble initializing sails.io.js client to work inside Svelte.
What used to work really well in the ...
0
votes
0
answers
19
views
Parasails JavaScript not loading after Promise resolved
I'm trying to load in data from the database dynamically with javascript and this helper function.
The function fetches a URLs which is routed to actions that return the parameters and a message after ...
0
votes
1
answer
319
views
Listening to sails socket in react
I'm trying to listen to changes from Sails socket in the front-end using react.
Server listen to changes in a MongoDB Collection and blasts the changes:
// Setting up connection to MongoDB
const ...
0
votes
1
answer
162
views
Use layout.ejs dynamic or how to edit a view-layout.js
Every Page which will be included in the layout.ejs has a view-pagename.js so I can use dynamic content in it.
How can I bring dynamic content a a default function to the layout page? There is no view-...
0
votes
1
answer
44
views
Sails.js sails.io.js, blueprints not getting events from .publish(), how to subscribe to all events?
I don't know why I'm not getting notification events from sails models from model.publish().
In pre-1.x sailsjs, similar client-side code had worked and I would get every event when records are ...
1
vote
0
answers
860
views
Request payload not found in network tab in chrome devtools
In the https://github.com/pantsel/konga application, I created a connection, but not found the payload data in the network tab.
I saw the request to "/api/kongnode", the only request was ...
0
votes
1
answer
629
views
How to connect socket from VueJs with Sails js built in socket with sails.io.js in vue js?
I am trying to connect VueJs with Sails js over socket connection through Sails.io.js package but got not success till now.
I have taken VuejS starter template and sails js starter template to make ...
0
votes
1
answer
262
views
update data in state array on socket event
Here is my code:
import React, { useEffect, useState } from 'react';
import Loader from './Loader.jsx';
import Unit from './Unit.jsx';
import Comments from './Comments.jsx';
export default function ...
3
votes
0
answers
119
views
sailsjs sockets and nginx proxy
i have a nodejs sails app proxied by nginx.Everything works fine but cant seem to connect to sails.io websocket.I get the error below in browser
Refused to connect to 'wss://youtmail.tk/socket.io/?...
1
vote
0
answers
123
views
Why isn't the client receiving updates from socket that has been subscribed to the Sails.js model when I change the data?
I've been trying to figure out how to get realtime updates with a React Native client connected to a Sails.js socket for the last few hours.
I'm not seeing any error messages that I'm aware of.
In the ...
0
votes
2
answers
108
views
How to prevent insert of data that is passed using query string in sails.js for post request?
I have created new table in mysql also created model and controller in sails.js. Now I am trying to insert data using sails. As we know when we create new modal in sails it will create new post, get ...
3
votes
1
answer
2k
views
https not working in localhost in sailsjs
I am trying to setup ssl in my local system. I am using windows machine with sails js application.
here is the configuration that I did.
/**
* Production environment settings
* (sails.config.*)
*
...
0
votes
0
answers
78
views
Sails.js socket broadcast from shell script
I have a Sails app and several Sails Shell scripts run by cron or other external triggers (mostly me typing in the shell). I would like to implement notifications in the browser via builtin Sails ...
0
votes
0
answers
92
views
why does sails.js crash after I restart my computer
I am new when it comes to using sail.js.
I installed Sail.js and then using sails lift I started the app it went well.
after sometime, I switched of my laptop, just to turn it on back I then an ...
0
votes
1
answer
166
views
Sails.JS's publish method doesn't work in a controller, but works in the console
Currently, I'm exploring web development to see what all the hype is about. Except for following a small 'create your first CRUD app in Node.JS' and some formal training in JavaScript, I have no ...
1
vote
0
answers
93
views
io.sails.js catch connection refused way
My question is about the way to catch socket connection refused.
Im using
"sails.io.js": "1.2.1",
"socket.io-client": "2.1.0"
According to doc
https://sailsjs.com/documentation/reference/web-...
0
votes
1
answer
1k
views
Duplicated event handlers when using websockets to track a users online status?
I would like to use websockets to track the time when a user was last seen, along with their current online status (if they are currently authenticated and making use of the application).
I have the ...
2
votes
1
answer
337
views
Sails error when sending response back
Ok so sockets connects and everything. I can debugg the controller but when it gets to line return res.ok() it breaks. I also had a res.json({message: "hello"}). but i get the same error.
/*** ...
1
vote
0
answers
248
views
link sails.io.js in angular2
I'm having trouble using sails.io.js with angular2. I use the angular2-sails library.
First I decided to use with a code inside my app.component.ts
this._sailsService.connect(this.url);
It works ...
0
votes
1
answer
57
views
sails.io.js script called twice
i have an issue with my sails application.
All of my js script are called twice but my less file are correctly called only one time.
This problem is present on chrome/edge/opera/firefox
Any idea ?
...
0
votes
1
answer
66
views
Using sails.io pubsub works with shortcuts, but not with RESTful record creation
I'm having an issue where I'm getting events from the sails resourceful pubsub when I create a record with the shortcut routes, but not with the RESTful routes.
In my client code, I have a sails ...
4
votes
1
answer
2k
views
How to use vue.js with sails js
I want to use vue.js as frontend for sails.js i tried to configure using the method given at
http://filipbartus.name/integrate-vue-loader-with-sails-js/ but it was not working for vue latest version ...
1
vote
1
answer
1k
views
How to get current socket object or id with in a sails controller?
I would like to access the currently connected socket id with in a sails.js (v0.12 ) controller function.
sails.sockets.getId(req.socket); is showing undefined since this is not a socket request
My ...
0
votes
1
answer
292
views
How to receive publish/message event from Sails server using Socket.io swift client
Currently i am building app using Sails server as a backend and iOS Swift as a client.
I am able to emit from iOS side to create user and receive data from server side, but i am not able to get ...
2
votes
0
answers
179
views
SailsJS get own socket ID on client
How can I get the socket ID on the client side in a clean way? I already use io.socket._raw.id to access the socket ID, but this is more a hack I think. I can't find a function like io.socket.getId() ...
2
votes
2
answers
403
views
Is there a way to disable jsonp in sails.io.js?
I'm trying to get sails.io.js to work with React Native.
When I try to use this with remote JS debugging switched on, an error pops up saying 'document is not defined', which is fine, because there ...
1
vote
0
answers
132
views
Performance gain from custom state container to Mobx?
We have a sails-js app whose ui is built with React and state container custom created with MVVM method. Our app takes ridiculously too much memory (over 400mb) even when user isn't doing anything. At ...
0
votes
1
answer
60
views
How to configure my sails app with https socket connection?
I have a sails backend API. And I already have an https connection.
(https://myapp.com/api)
How do I connect to a sails socket with my client side (Android and iOS) having an https connection? I ...
0
votes
1
answer
104
views
not getting updates on model. socket.io with sails.js
I have a sails app created using the options --no-linker --no-front end. The front end of the application is written in angular2. Making request get and post, seems to work fine.
When i send a get ...
-1
votes
1
answer
68
views
I have to Export around 50 page pdf in node js which module i have to use?
Currently I am using pdfmake module in my sails app to export pdf.But,when size of pdf increase it is taking too much time to export pdf,Ihave to export pdf of around 50 pages.So,Which module i can ...
1
vote
1
answer
253
views
how to emit a message from browser when using Sails.io.js [duplicate]
Before I would just
<script>
var socket = io.connect(URL);
socket.emit("hello", {});
</script>
Using Sails.io.js, I tried io.sails.emit("myevent", jsonData) ... but can't do that:
io....
0
votes
1
answer
695
views
Sails.io.js io.socket.get('/user',...) Not implemented in core yet
Create e.g. assets/js/dependencies/app.io.js with:
io.socket.on('connect', function socketConnected() {
console.debug("This is from the connect: ", io.socket);
console.debug("WebSocket is ...
0
votes
0
answers
160
views
Connecting Sails Socket IO to Sails server running in consul
There's this μService architecture running as the backend, with a consul instance managing all the services. There's a particular server, A made with Sails, and with some relevant socket logic I'd ...
1
vote
1
answer
66
views
Sailsjs table needs to be updated automatically without using any cron
I am using SAILS JS and mysql adapter is being used. I have a model named as User with the following fields ID, USERNAME, EMAIL, ACTIVE_STATUS and CREATED_DATE.
By Default, active_status is set as 0. ...
1
vote
1
answer
456
views
sails js sockets - Maximum call stack size exceeded error
I am new to sailsjs and stuck while trying to implement this example:
http://sailsjs.org/documentation/concepts/realtime
api/controllers/SayController.js
module.exports = {
hello: function(req, ...
0
votes
1
answer
92
views
How to handle every socket response in SailsJS?
In SailsJS every socket response contains JWR headers. How I can inject my custom header in every socket response ?
0
votes
1
answer
73
views
How to bind two or more folder for sailsjs controller
I'm creating a node_module which will add some new model and the controller to the sails app so I need to merge the node_module model and the controller to the sailsjs model and the controller so ...
0
votes
1
answer
563
views
how to use sails.io.js version 0.11.3 in node server
I would like to create a chat application in my sailjs based project, How and where can i configure the socket and related setting in the server ? I got a sample project from this repository but it is ...
0
votes
1
answer
204
views
Enabling sockets.io in sails to run on multiple ports
I have to set sails app where I can have socket.io connections on multiple ports - for example authentication on port 3999 and data synchronization on port 4999.
Any way to do so ?
1
vote
1
answer
2k
views
Sails socket io connecting to a different url than the one passed in
In production when I try to connect to my socket client in sails at 'https://something.com/api/' from the client url 'https://something.com/' I get a 404
https://something.com/socket.io/?...
0
votes
1
answer
163
views
Prevent Socket connection from initializing again
I am trying to make a chat app which sends first message as "Hi. there".
But due to some some reasons (unstable internet connection might be one) the socket get initialized multiple times and sends ...
2
votes
1
answer
5k
views
How to connect Socket.IO-Client to Sails.js server?
I've spent quite a while trying to connect Socket.IO-Client to a server running on Sails.js framework. The client is basically a simple JavaScript application running with Node.js on Raspberry Pi.
...
0
votes
1
answer
366
views
Sailsjs websocket not working in the call of io.socket.on()
My angular controller waits for the create signal of the web socket over a model to refresh the data im using on the view.
The name of the sails model is Noticia, so the identifier is noticia.
Here ...
5
votes
0
answers
876
views
sails.js socket.io through nginx shows lots of 'upstream timed out'
I'm running a couple of sails.js backend instances behind an nginx proxy with sticky sessions.
I keep seeing a lot of messages in my nginx error.log regarding sails.js /socket.io/ URLs timing out:
...
0
votes
1
answer
159
views
Using HTML instead of ejs in sails
I am a newbie on sails framework and I started working on it then found that everything is in ejs. When I converted it into the HTML then it didn't work.
How to write client-side in HTML using ...
1
vote
1
answer
39
views
Sockets update all the users who are subscribed to the model itself expect for the user who got updated
I have user get subscribed to chat users, the user has the ability to make himself online or offline through sockets,
One of the users have the role of the manager, where he can force users to be ...
1
vote
1
answer
332
views
Sails JS, how to map request parameter to model?
I want to map json data from request.params to model in my controller class.
It have some action in controller before save model to database.
Does it has the solution to auto map json data to model ...
2
votes
0
answers
69
views
forever keep restarting sails after every 100s
I have built web socket based application using sails js(v0.11.2) and mysql (5.6.22) with sails_mysql_live_connect .
I have set mysql wait_timeout to 100s for GC(Garbage collector) to close any ...