Coder Social home page Coder Social logo

broken? about rust-websocket HOT 15 CLOSED

websockets-rs avatar websockets-rs commented on August 23, 2024
broken?

from rust-websocket.

Comments (15)

cyderize avatar cyderize commented on August 23, 2024

You can use the sha1 from my git repository by using the temp branch of rust-websocket.

In Cargo.toml:

[dependencies.websocket]
git = "https://github.com/cyderize/rust-websocket.git"
branch = "temp"

I opened a pull request a few days ago to the owner of rust-sha1, but they seem to be hard to contact at the moment.

from rust-websocket.

BenTheElder avatar BenTheElder commented on August 23, 2024

Unfortunately this leaves packages that depend on websocket unable to publish (to crates.io) in the meantime. Perhaps if the PR is not accepted within a reasonable timeline a fork could be published under an alternate name or something? Local/relative path vendorizing unfortunately seems prohibited by cargo for published packages; as well as git dependencies.

from rust-websocket.

cyderize avatar cyderize commented on August 23, 2024

Yeah, not having sha1 working is pretty much why I haven't been able to publish this version to crates.io.

I've decided to use sha1-hasher now, since it works - hopefully that should make it possible to continue using the library. That version is in the sha1-hasher branch and is published as 0.9.6 on crates.io.

from rust-websocket.

BenTheElder avatar BenTheElder commented on August 23, 2024

Looks like a good solution. When you make the switch I'll finally move slack-rs to 1.0-alpha.

from rust-websocket.

cyderize avatar cyderize commented on August 23, 2024

The crates.io version should now be working, although you might want to wait a while before moving to 1.0-alpha.

I've still got to deal with associated types, and there will likely be some large changes to the API (I might try to mirror the stream splitting from RFC517 rather than having clones are Arcs everywhere).

from rust-websocket.

BenTheElder avatar BenTheElder commented on August 23, 2024

Ok. I've gone ahead and started updating because there is so much that needs to be changed in my code to reach 1.0, but none of the calls to websocket need updating since the switch to websocket's hyper so far.

from rust-websocket.

cyderize avatar cyderize commented on August 23, 2024

I mean you may also need to change some of the websocket calls eventually as well - but they shouldn't be too major anyway (and I'll happily help out when I finish the changes).

from rust-websocket.

BenTheElder avatar BenTheElder commented on August 23, 2024

Ok, I'll continue to track crates.io 's latest as much as possible. Thanks.

from rust-websocket.

BenTheElder avatar BenTheElder commented on August 23, 2024

So i've updated to 0.9.6, and updated my demo project, and while i'm not 100% certain it isn't my fault i'm getting ResponseError("Sec-WebSocket-Accept is invalid") when connecting to slack. I'm going to do some more debugging and report back.

from rust-websocket.

BenTheElder avatar BenTheElder commented on August 23, 2024

Well disabling the call to check res.validate(&key) after connecting seems to leave everything else functioning as expected, so I'd say there's a bug somewhere between slack and rust-websocket.

from rust-websocket.

cyderize avatar cyderize commented on August 23, 2024

Yes, there seems to be a problem with validation - I neglected a lot of client-side testing, and this doesn't appear to work. I'll have a closer look at it (I've put it in issue #13).

from rust-websocket.

BenTheElder avatar BenTheElder commented on August 23, 2024

Ok, thanks.

from rust-websocket.

cyderize avatar cyderize commented on August 23, 2024

I think I've fixed the issue in 0.9.7. The WebSocketKey was being written incorrectly.

In actual fact, slack should've completely rejected the connection since the header was invalid, but I suppose it's designed to be a bit more robust.

from rust-websocket.

BenTheElder avatar BenTheElder commented on August 23, 2024

I've re-enabled validation after switching to 0.9.7 and it seems to be working as expected.

from rust-websocket.

cyderize avatar cyderize commented on August 23, 2024

I've now removed the dependency on a separate SHA-1 crate, since OpenSSL can already do SHA-1 (and much faster than any Rust crates).

Version 0.10.0 introduces a different API, so see the examples in examples/client.rs and examples/server.rs.

I've removed the clone() and Mutex stuff, instead using a split() method to allow sending and receiving from different threads.

If you still need to be able to clone(), you'll have to put the use an Arc<Mutex<Client>>.

from rust-websocket.

Related Issues (20)

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.