Coder Social home page Coder Social logo

What's the status? about wamp-rs HOT 6 CLOSED

Boscop avatar Boscop commented on August 25, 2024
What's the status?

from wamp-rs.

Comments (6)

dyule avatar dyule commented on August 25, 2024

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.

from wamp-rs.

Boscop avatar Boscop commented on August 25, 2024

Thanks! Btw, which js lib would you recommend to use in the browser to communicate with wamp-rs?
I want to do a web gui for a Rust app, so I need to send key strokes, events, and the server needs to push gui data updates.

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?

from wamp-rs.

dyule avatar dyule commented on August 25, 2024

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!

from wamp-rs.

Boscop avatar Boscop commented on August 25, 2024

Thanks. But how can I authenticate users without cookies so that nobody can impersonate another user?
Also, with publishing, doesn't that send all messages to all clients, and they then decide which ones to look at? That would cause a lot of unnecessary traffic. If possible I want to send only to the client that should get the message..

from wamp-rs.

dyule avatar dyule commented on August 25, 2024

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.

from wamp-rs.

Boscop avatar Boscop commented on August 25, 2024

It should be possible to read the cookie in Handler::on_request()
housleyjk/ws-rs#110

from wamp-rs.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.