Comments (8)
This is something that is intentionally left up to your application code to implement, and it's extremely easy to do so. I'll try to put up a wiki page with an example since I've gotten this question before.
from websocket-node.
turtle-
Thanks for your prompt response.
Can you please throw in just some quick code here, because i am stuck in the dev of my application because of this :(
I will make a donation if that is the case.
Thanks
from websocket-node.
I'm writing the wiki page now. I'll have something posted in the next 10 minutes.
from websocket-node.
Thank you so much.
Also maybe you can explain how we can assign names the the sessions.
For example ip 192.168.1.1 opens a session, and he sends "SESSION_ID:Richard".
Then the session will be renamed Richard, and can be used to push messages to the user. ( session.send ( richard, "hello" ) etc ).
I am sorry if my questions sound stupid but I am just starting with websockets and I am very excited about all this.
Thanks
from websocket-node.
Again, that is left to the developer intentionally. You can attach any arbitrary additional properties you wish to the connection object since JavaScript is a dynamic language, and you can add open WebSocketConnection objects to a hash based on your SESSION_ID when accepting the connection and remove it on the 'close' event.
from websocket-node.
I will struggle to learn more java... i`ve been up 3 days straight, learning it, since i found this server.
I am working mostly in .net on the client side.
- I meant javascript *
from websocket-node.
Cool cool. JavaScript is a very fun and dynamic language, and I absolutely love working with it. Do take note though, Java and JavaScript are entirely different and unrelated things. If you try looking for Java solutions when you are working with JavaScript, you will find yourself very confused.
from websocket-node.
Here's the wiki page:
https://github.com/Worlize/WebSocket-Node/wiki/How-to:-List-all-connected-sessions-&-Communicating-with-a-specific-session-only
from websocket-node.
Related Issues (20)
- The NPM package is not a place for politics HOT 1
- The NPM package is not a place for politics HOT 2
- Get URL Parameters HOT 1
- Ssl using cloudflare
- Send bytes query
- broadcast
- How to connect to multiple WebSockets? HOT 1
- install of websocket and immediatly disapear
- How Can we get Connection URL from w3cwebsocket to webSocket.Server Connection
- Similar to emit socket.io HOT 1
- send to all connected clients HOT 2
- Getting vulnerable issue [email protected]
- Need more docs on the usage of client
- Unable to connect with auth info in url and special characters HOT 1
- connection.on('message', ...) - where this event is emitted ? HOT 1
- This pkg appears abandoned. I recommend switching to "ws", it's a very similar implementation HOT 4
- Malware dependency
- Update UTF-8 Validation Code
- Request to Upgrade es5-ext Dependency to Resolve Veracode Vulnerability HOT 5
- websocket doesn't work under bun HOT 2
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 websocket-node.