Comments (6)
Sorry I have no idea what you're talking about, can you give more details?
from session.socket.io.
Sorry functioncallback, i wasn't clear. Let me explain :
My purpose is to use the namespace feature of socket.io with your plugin. In the docs of socket.io, it is used like this as an example :
var chat = io.of('/chat').on('connection', function() {});
But when i try to integrate this to your plugin like below :
var SessionSockets = require('session.socket.io')
, sessionSockets = new SessionSockets(io.of('/chat'), sessionStore, cookieParser);
it states that "Object has no method 'on' " in "session.socket.io.js:5
So in that line, i had to change io.sockets.on( ...... to io.on( ....... ( I removed .sockets)
That way it worked! As i'm new to node.js and socket.io i don't really have any idea how it's architected under the hood but, following the main socket.io docs led me to do it.
If you know any proper way to do this, i'd be glad to hear.
Thanks
from session.socket.io.
Hm I see. Today sessionSockets gives you an api to call only .on('connection', ...) and not .of('/namespace').on(...), however that would be pretty simple to implement, so we could do sessionSockets.of('/ns').on(...) the same way we do when using the io object directly, and it would just delegate internally. I will let you know when I make this change, for now you may keep the way you have done since it's working fine. Thanks for sharing more details from your use case.
from session.socket.io.
Thanks for your help functioncallback. I hope others can also benefit from the use case.
from session.socket.io.
The pull request I submitted implements the 'of' method.
from session.socket.io.
Sorry it took awhile @kanle485, this is now done and published on npm as version 0.1.3. Please let me know it that works for you. Thanks!
from session.socket.io.
Related Issues (20)
- get data out of sessionStore HOT 5
- sessionStore not refreshed? HOT 1
- Undefined error HOT 2
- Session is undefined HOT 4
- easyrtc 1.0.7 HOT 2
- Broken when using Express 4.0 because of changed middleware for cookies HOT 2
- Problems with example code in README.md HOT 1
- Please add 4th param "key" to README.md HOT 2
- session.socket.io doesn't work HOT 15
- You can't directly work with session when you're using connect-mongo store HOT 4
- Compatibility with socket.io 1.0.6 ? HOT 4
- Session resets when navigating pages HOT 1
- your example fails in IE HOT 1
- It doesn't set cookies if there are none HOT 2
- Could not lookup session by key HOT 2
- Express 4 session null error HOT 2
- Better solution HOT 2
- socket.emit is not working in session.socket.io
- Session not updating HOT 1
- How to use in koa2?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from session.socket.io.