-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's the status? #1
Comments
It does now! This is part of some other work I've been doing, and I've been focused on those, but with the recent massive changes to serde, it makes sense to bring this up to date. |
Thanks! Btw, which js lib would you recommend to use in the browser to communicate with wamp-rs? And for a different app I want to send push notifications to users, so I need to read the user id from the cookie when a websocket connection comes in, is this possible with wamp-rs? |
I've personally used AutobahnJS for my websocket library in Javascript, and had no problems at all. As for reading from a cookie, I don't think the WAMP protocol supports that directly, since the router isn't supposed to do anything but relay messages, and the cookie would get lost by the time it got to the callee. I suspect you'd be best to store a user ID (or maybe the session id) in localStorage on the client side, and then pass that along. Another thing that might be useful is the publish blacklist/whitelist feature, which is part of the advanced profile, but hasn't been implemented here yet. Something you could do, if your user id was 1234, is subscribe to a topic like com.my.topic.1234. Then you can publish to com.my.topic.1234 for that particular user. However, given that WAMP-RS doesn't currently support user authentication, you'd have to be careful about security there. I hope those random thoughts help. Any feature you would like to see in WAMP-RS, feel free to request it, or better yet, implement! |
Thanks. But how can I authenticate users without cookies so that nobody can impersonate another user? |
For authentication, until I (or someone else) implements it in WAMP-RS, I don't know how you might do it. The ws library didn't support cookies when last I checked, although they might now. I guess that's a pretty critical feature for what you're trying to accomplish. But with publishing, no every client doesn't see every message. They only see the messages for topics they are subscribed to. So as long as each user had their own topic for messages, only they would see the notifications. |
It should be possible to read the cookie in Handler::on_request() |
Does this work with the latest ws-rs and serde?
The text was updated successfully, but these errors were encountered: