socket-controllers | Use class-based controllers to handle websocket events | Socket library
kandi X-RAY | socket-controllers Summary
kandi X-RAY | socket-controllers Summary
Use class-based controllers to handle websocket events.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of socket-controllers
socket-controllers Key Features
socket-controllers Examples and Code Snippets
Community Discussions
Trending Discussions on socket-controllers
QUESTION
I'm trying to use the express-session library in my MERN stack app along with socket.io for the real time messaging part of the app.
For authentication I am using express-session and would like to use that same middleware for socket connections, however when I followed the answer for the same problem here, the middlware just simply didn't proceed to the next function and so when trying to connect, the middlware never went to the onConnect handler and the handshake never completed.
...ANSWER
Answered 2021-Sep-13 at 17:28Update, I found the answer.
In the socket.io documentation it goes over how you are able to use middleware and express-session.
Crucially it gives a wrapper function which seems to sort things:
QUESTION
I'm feeling really stupid about that, but here's my problem.
I'm using Socket-Controller and routing-controller in the same NodeTS App. Therefore i needed to create two express servers. One is listening to port 3000 or whatever the env is, and the other on port 65080. Locally, this works perfect. Now on GAE, my HTTP Server for the normal requests is working, while my SocketServer always times out.
If it helps, here is my app.yaml:
...ANSWER
Answered 2020-Apr-13 at 08:29Well, the solution was rather easy.
I needed to bind the Socket Server to the same HTTP Server instance, which express is using. Below are my changes.
socketLoader.ts
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install socket-controllers
Install socket-controllers: npm install socket-controllers
Install reflect-metadata shim: npm install reflect-metadata and make sure to import it in a global place, like app.ts: import 'reflect-metadata';
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page