Giter Club home page Giter Club logo

Comments (6)

daniel-abramov avatar daniel-abramov commented on August 11, 2024 1

@agalakhov has solved this issue in his latest commits. Check out the new version.

from tokio-tungstenite.

daniel-abramov avatar daniel-abramov commented on August 11, 2024

We'll see how to implement this while keeping it transparent and flexible. Once we discussed this topic: #5 (comment)

At the moment I'm not sure if it should be a feature, most likely we need a separate crate with the helper/connector like in hyper. We have to be consistent with the existing "conventions" used in tokio. I'll try to check what's the state with hyper in this regard and probably talk to Alex Crichton.

from tokio-tungstenite.

flosse avatar flosse commented on August 11, 2024

@agalakhov has solved this issue in his latest commits. Check out the new version.

Could you reference a commit? I tried v0.2.1 but that didn't work :(

from tokio-tungstenite.

daniel-abramov avatar daniel-abramov commented on August 11, 2024

v0.2.1 should already contain the required changes, but you have to use a corresponding function: https://docs.rs/tokio-tungstenite/0.2.1/tokio_tungstenite/fn.connect_async.html

from tokio-tungstenite.

flosse avatar flosse commented on August 11, 2024

...how is connect_async related to TLS?

from tokio-tungstenite.

agalakhov avatar agalakhov commented on August 11, 2024

This is the only function that has something to do with TLS. On a client, just providing a wss:// URL to connect_async() would result in establishing of a TLS connection.

On a server, Tungstenite does not accept connections itself. It only upgrades an existing connection to a websocket one. It is not possible to automatically switch between TLS and plain connections since they use different ports and the TLS one has certificates and even may have SNI, and this is obviously out of the scope of Tungstenite. The server-side code must accept the connection including the proper TLS handshake with correct certificates, if any.

Upgrading an existing connection from other libraries to a websocket one does not require any specific TLS support from Tungstenite. This is only needed for client-side connections that are initiated by providing an URL.

from tokio-tungstenite.

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.