Socket.IO

React Native, NodeJS, Socket.io

蹲街弑〆低调 提交于 2021-01-10 03:29:46
问题 i am trying to implement a 1-1 private messaging feature inside my app, where 2 users can exchange messages live if they are both on the chat screen at the same time and if not the messages get stored in my postgres database and when the user opens the chat again they are loaded. Currently with my code, when both users chat are open, when i try sending a message, the message does not get sent live i need to refresh the app in order for the chat to update. I think my socket is working since my

React Native, NodeJS, Socket.io

孤人 提交于 2021-01-10 03:26:54
问题 i am trying to implement a 1-1 private messaging feature inside my app, where 2 users can exchange messages live if they are both on the chat screen at the same time and if not the messages get stored in my postgres database and when the user opens the chat again they are loaded. Currently with my code, when both users chat are open, when i try sending a message, the message does not get sent live i need to refresh the app in order for the chat to update. I think my socket is working since my

Get SocketIO ID from Express Request

隐身守侯 提交于 2021-01-08 15:41:25
问题 A user of my system will access a page to pull lots of data, at least 500 records, from server Foo . Once 50 records have been gathered, Express will begin to render the page to display the first 50 records to the user (only the first 50 records need to be displayed initially). Once the system has pulled all 500 records from Foo I want to send the user a message letting them know that the operation is complete. My idea is to call the socket emit function once the processing is complete,

Get SocketIO ID from Express Request

泄露秘密 提交于 2021-01-08 15:41:17
问题 A user of my system will access a page to pull lots of data, at least 500 records, from server Foo . Once 50 records have been gathered, Express will begin to render the page to display the first 50 records to the user (only the first 50 records need to be displayed initially). Once the system has pulled all 500 records from Foo I want to send the user a message letting them know that the operation is complete. My idea is to call the socket emit function once the processing is complete,

Get SocketIO ID from Express Request

社会主义新天地 提交于 2021-01-08 15:39:34
问题 A user of my system will access a page to pull lots of data, at least 500 records, from server Foo . Once 50 records have been gathered, Express will begin to render the page to display the first 50 records to the user (only the first 50 records need to be displayed initially). Once the system has pulled all 500 records from Foo I want to send the user a message letting them know that the operation is complete. My idea is to call the socket emit function once the processing is complete,

Socket.IO Best way to send messages between two users? [closed]

Deadly 提交于 2021-01-08 05:29:49
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . Improve this question I want to know what is the best way to send messages between two users? I know you can do rooms and join them but you have to "create" them first. Think of it like chat messenger. You only show the messages you recieve between those two users. I can do one

How to use socket io instance on multiple files in express.js app

坚强是说给别人听的谎言 提交于 2021-01-07 03:00:11
问题 In my express app, generated with express-generator , I want to use the io of socket.io in some other controller files to emit data to client sockets. My approach is below, but I get the following error with that. It would be a great favor if someone can help me in this case. (node:11376) UnhandledPromiseRejectionWarning: TypeError: io.emit is not a function at F:\backend\controllers\LessonController.js:169:9 In the express apps, generated by express-generator , the process of creating the

Websocket Cloudflare with Nginx 520 error

我是研究僧i 提交于 2021-01-07 02:13:56
问题 I am jumping in on a project with some socket issues over SSL and Cloudflare... I know.. I have read about 50 different stack overflow posts and 200 blog posts to try to figure this out. The project works on my local dev server/computer just fine... I think I am on the right track - But could use some help/pointers if ya'll can. First, I thought it was weird that the /socket-io/ proxy_pass was at port 6379, the same as redis... Maybe it should be? When this was set at 6379, the socket

Websocket Cloudflare with Nginx 520 error

一曲冷凌霜 提交于 2021-01-07 02:10:23
问题 I am jumping in on a project with some socket issues over SSL and Cloudflare... I know.. I have read about 50 different stack overflow posts and 200 blog posts to try to figure this out. The project works on my local dev server/computer just fine... I think I am on the right track - But could use some help/pointers if ya'll can. First, I thought it was weird that the /socket-io/ proxy_pass was at port 6379, the same as redis... Maybe it should be? When this was set at 6379, the socket

Websocket Cloudflare with Nginx 520 error

孤人 提交于 2021-01-07 02:10:13
问题 I am jumping in on a project with some socket issues over SSL and Cloudflare... I know.. I have read about 50 different stack overflow posts and 200 blog posts to try to figure this out. The project works on my local dev server/computer just fine... I think I am on the right track - But could use some help/pointers if ya'll can. First, I thought it was weird that the /socket-io/ proxy_pass was at port 6379, the same as redis... Maybe it should be? When this was set at 6379, the socket