kaichaosun / rlt

Localtunnel implementation in Rust, expose local API to the public.
MIT License
93 stars 11 forks source link

failled to install localtunnel #30

Closed koakh closed 5 months ago

koakh commented 1 year ago

hello any advice or solution to compile latest and greates version of localtunnel?

❯ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/mario/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.72.0 (5680fa18f 2023-08-23)

❯ cargo install localtunnel
    Updating crates.io index
  Installing localtunnel v0.1.2
    Updating crates.io index
  Downloaded proc-macro2 v1.0.67
  Downloaded 1 crate (43.7 KB) in 1.26s
   Compiling proc-macro2 v1.0.67
   Compiling quote v1.0.33
   Compiling syn v2.0.32
   Compiling syn v1.0.109
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling derive_more v0.99.17
   Compiling clap_derive v3.2.25
   Compiling tokio-macros v2.1.0
   Compiling serde_derive v1.0.188
   Compiling openssl-macros v0.1.1
   Compiling thiserror-impl v1.0.48
   Compiling actix-macros v0.2.4
   Compiling async-trait v0.1.73
   Compiling openssl v0.10.57
   Compiling tokio v1.32.0
   Compiling thiserror v1.0.48
   Compiling clap v3.2.25
   Compiling serde v1.0.188
   Compiling native-tls v0.2.11
   Compiling serde_json v1.0.106
   Compiling tokio-util v0.7.8
   Compiling actix-rt v2.9.0
   Compiling tokio-native-tls v0.3.1
   Compiling serde_urlencoded v0.7.1
   Compiling actix-router v0.5.1
   Compiling envy v0.4.2
   Compiling actix-server v2.3.0
   Compiling h2 v0.3.21
   Compiling actix-codec v0.5.1
   Compiling actix-web-codegen v4.2.2
   Compiling hyper v0.14.27
   Compiling actix-http v3.4.0
   Compiling hyper v1.0.0-rc.4
   Compiling actix-web v4.4.0
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.20
   Compiling localtunnel-client v0.1.2
   Compiling localtunnel-server v0.1.2
error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/lib.rs:80:47
    |
80  | ...                   .serve_connection(stream, service)
    |                        ---------------- ^^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
    |                        |
    |                        required by a bound introduced by this call
    |
    = help: the following other types implement trait `hyper::rt::Read`:
              Box<T>
              hyper::upgrade::Upgraded
              &mut T
note: required by a bound in `hyper::server::conn::http1::Builder::serve_connection`
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/server/conn/http1.rs:359:12
    |
353 |     pub fn serve_connection<I, S>(&self, io: I, service: S) -> Connection<I, S>
    |            ---------------- required by a bound in this associated function
...
359 |         I: Read + Write + Unpin,
    |            ^^^^ required by this bound in `Builder::serve_connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/lib.rs:80:47
    |
80  | ...                   .serve_connection(stream, service)
    |                        ---------------- ^^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
    |                        |
    |                        required by a bound introduced by this call
    |
    = help: the following other types implement trait `hyper::rt::Write`:
              Box<T>
              hyper::upgrade::Upgraded
              &mut T
note: required by a bound in `hyper::server::conn::http1::Builder::serve_connection`
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/server/conn/http1.rs:359:19
    |
353 |     pub fn serve_connection<I, S>(&self, io: I, service: S) -> Connection<I, S>
    |            ---------------- required by a bound in this associated function
...
359 |         I: Read + Write + Unpin,
    |                   ^^^^^ required by this bound in `Builder::serve_connection`

error[E0599]: the method `with_upgrades` exists for struct `Connection<TcpStream, ServiceFn<[closure@lib.rs:74:46], Incoming>>`, but its trait bounds were not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/lib.rs:81:30
   |
79 |                           if let Err(err) = http1::Builder::new()
   |  ___________________________________________-
80 | |                             .serve_connection(stream, service)
81 | |                             .with_upgrades()
   | |                             -^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
   | |_____________________________|
   | 
   |
  ::: /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/net/tcp/stream.rs:69:5
   |
69 |       pub struct TcpStream {
   |       --------------------
   |       |
   |       doesn't satisfy `tokio::net::TcpStream: hyper::rt::Read`
   |       doesn't satisfy `tokio::net::TcpStream: hyper::rt::Write`
   |
   = note: the full type name has been written to '/tmp/cargo-install4BlL2K/release/deps/localtunnel_server-0b8016a1f3e0f3e9.long-type-11210506043376513307.txt'
   = note: the following trait bounds were not satisfied:
           `tokio::net::TcpStream: hyper::rt::Read`
           `tokio::net::TcpStream: hyper::rt::Write`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:25:72
    |
25  |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
    |                                  ------------------------------------- ^^^^^^^^^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
    |                                  |
    |                                  required by a bound introduced by this call
    |
    = help: the following other types implement trait `hyper::rt::Read`:
              Box<T>
              hyper::upgrade::Upgraded
              &mut T
note: required by a bound in `hyper::client::conn::http1::handshake`
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:117:8
    |
115 | pub async fn handshake<T, B>(io: T) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
    |              --------- required by a bound in this function
116 | where
117 |     T: Read + Write + Unpin + Send + 'static,
    |        ^^^^ required by this bound in `handshake`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:25:72
    |
25  |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
    |                                  ------------------------------------- ^^^^^^^^^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
    |                                  |
    |                                  required by a bound introduced by this call
    |
    = help: the following other types implement trait `hyper::rt::Write`:
              Box<T>
              hyper::upgrade::Upgraded
              &mut T
note: required by a bound in `hyper::client::conn::http1::handshake`
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:117:15
    |
115 | pub async fn handshake<T, B>(io: T) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
    |              --------- required by a bound in this function
116 | where
117 |     T: Read + Write + Unpin + Send + 'static,
    |               ^^^^^ required by this bound in `handshake`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:25:87
   |
25 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                                                                       ^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:25:87
   |
25 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                                                                       ^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:25:34
   |
25 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:25:34
   |
25 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:25:34
   |
25 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:25:34
   |
25 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:27:31
   |
27 |             if let Err(err) = conn.await {
   |                               ^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:27:31
   |
27 |             if let Err(err) = conn.await {
   |                               ^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:27:36
   |
27 |             if let Err(err) = conn.await {
   |                                    ^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:27:36
   |
27 |             if let Err(err) = conn.await {
   |                                    ^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:35:72
    |
35  |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
    |                                  ------------------------------------- ^^^^^^^^^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
    |                                  |
    |                                  required by a bound introduced by this call
    |
    = help: the following other types implement trait `hyper::rt::Read`:
              Box<T>
              hyper::upgrade::Upgraded
              &mut T
note: required by a bound in `hyper::client::conn::http1::handshake`
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:117:8
    |
115 | pub async fn handshake<T, B>(io: T) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
    |              --------- required by a bound in this function
116 | where
117 |     T: Read + Write + Unpin + Send + 'static,
    |        ^^^^ required by this bound in `handshake`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:35:72
    |
35  |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
    |                                  ------------------------------------- ^^^^^^^^^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
    |                                  |
    |                                  required by a bound introduced by this call
    |
    = help: the following other types implement trait `hyper::rt::Write`:
              Box<T>
              hyper::upgrade::Upgraded
              &mut T
note: required by a bound in `hyper::client::conn::http1::handshake`
   --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:117:15
    |
115 | pub async fn handshake<T, B>(io: T) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
    |              --------- required by a bound in this function
116 | where
117 |     T: Read + Write + Unpin + Send + 'static,
    |               ^^^^^ required by this bound in `handshake`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:35:87
   |
35 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                                                                       ^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:35:87
   |
35 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                                                                       ^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:35:34
   |
35 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:35:34
   |
35 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:35:34
   |
35 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:35:34
   |
35 |         let (mut sender, conn) = hyper::client::conn::http1::handshake(client_stream).await?;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:37:35
   |
37 |                 if let Err(err) = conn.await {
   |                                   ^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:37:35
   |
37 |                 if let Err(err) = conn.await {
   |                                   ^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:37:40
   |
37 |                 if let Err(err) = conn.await {
   |                                        ^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Read`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:8
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |        ^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:37:40
   |
37 |                 if let Err(err) = conn.await {
   |                                        ^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
   |
   = help: the following other types implement trait `hyper::rt::Write`:
             Box<T>
             hyper::upgrade::Upgraded
             &mut T
note: required by a bound in `hyper::client::conn::http1::Connection`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/client/conn/http1.rs:52:15
   |
50 | pub struct Connection<T, B>
   |            ---------- required by a bound in this struct
51 | where
52 |     T: Read + Write + Send + 'static,
   |               ^^^^^ required by this bound in `Connection`

error[E0277]: the trait bound `hyper::upgrade::Upgraded: AsyncRead` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:69:77
   |
69 | ...                   if let Err(err) = tokio::io::copy_bidirectional(&mut response_upgraded, &mut request_upgraded).await {
   |                                         ----------------------------- ^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncRead` is not implemented for `hyper::upgrade::Upgraded`
   |                                         |
   |                                         required by a bound introduced by this call
   |
   = help: the following other types implement trait `AsyncRead`:
             hyper_tls::stream::MaybeHttpsStream<T>
             tokio_native_tls::TlsStream<S>
             Box<T>
             hyper::upgrade::Upgraded
             reqwest::Upgraded
             tokio::fs::File
             tokio_util::io::stream_reader::StreamReader<S, B>
             tokio_util::either::Either<L, R>
           and 27 others
note: required by a bound in `copy_bidirectional`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/io/util/copy_bidirectional.rs:74:8
   |
72 | pub async fn copy_bidirectional<A, B>(a: &mut A, b: &mut B) -> Result<(u64, u64), std::io::Error>
   |              ------------------ required by a bound in this function
73 | where
74 |     A: AsyncRead + AsyncWrite + Unpin + ?Sized,
   |        ^^^^^^^^^ required by this bound in `copy_bidirectional`

error[E0277]: the trait bound `hyper::upgrade::Upgraded: AsyncWrite` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:69:77
   |
69 | ...                   if let Err(err) = tokio::io::copy_bidirectional(&mut response_upgraded, &mut request_upgraded).await {
   |                                         ----------------------------- ^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncWrite` is not implemented for `hyper::upgrade::Upgraded`
   |                                         |
   |                                         required by a bound introduced by this call
   |
   = help: the following other types implement trait `AsyncWrite`:
             hyper_tls::stream::MaybeHttpsStream<T>
             tokio_native_tls::TlsStream<S>
             Box<T>
             hyper::upgrade::Upgraded
             reqwest::Upgraded
             tokio::fs::File
             tokio_util::either::Either<L, R>
             tokio_util::io::sink_writer::SinkWriter<S>
           and 26 others
note: required by a bound in `copy_bidirectional`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/io/util/copy_bidirectional.rs:74:20
   |
72 | pub async fn copy_bidirectional<A, B>(a: &mut A, b: &mut B) -> Result<(u64, u64), std::io::Error>
   |              ------------------ required by a bound in this function
73 | where
74 |     A: AsyncRead + AsyncWrite + Unpin + ?Sized,
   |                    ^^^^^^^^^^ required by this bound in `copy_bidirectional`

error[E0277]: the trait bound `hyper::upgrade::Upgraded: AsyncRead` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:69:101
   |
69 | ...                   if let Err(err) = tokio::io::copy_bidirectional(&mut response_upgraded, &mut request_upgraded).await {
   |                                         -----------------------------                         ^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncRead` is not implemented for `hyper::upgrade::Upgraded`
   |                                         |
   |                                         required by a bound introduced by this call
   |
   = help: the following other types implement trait `AsyncRead`:
             hyper_tls::stream::MaybeHttpsStream<T>
             tokio_native_tls::TlsStream<S>
             Box<T>
             hyper::upgrade::Upgraded
             reqwest::Upgraded
             tokio::fs::File
             tokio_util::io::stream_reader::StreamReader<S, B>
             tokio_util::either::Either<L, R>
           and 27 others
note: required by a bound in `copy_bidirectional`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/io/util/copy_bidirectional.rs:75:8
   |
72 | pub async fn copy_bidirectional<A, B>(a: &mut A, b: &mut B) -> Result<(u64, u64), std::io::Error>
   |              ------------------ required by a bound in this function
...
75 |     B: AsyncRead + AsyncWrite + Unpin + ?Sized,
   |        ^^^^^^^^^ required by this bound in `copy_bidirectional`

error[E0277]: the trait bound `hyper::upgrade::Upgraded: AsyncWrite` is not satisfied
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/localtunnel-server-0.1.2/src/proxy.rs:69:101
   |
69 | ...                   if let Err(err) = tokio::io::copy_bidirectional(&mut response_upgraded, &mut request_upgraded).await {
   |                                         -----------------------------                         ^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncWrite` is not implemented for `hyper::upgrade::Upgraded`
   |                                         |
   |                                         required by a bound introduced by this call
   |
   = help: the following other types implement trait `AsyncWrite`:
             hyper_tls::stream::MaybeHttpsStream<T>
             tokio_native_tls::TlsStream<S>
             Box<T>
             hyper::upgrade::Upgraded
             reqwest::Upgraded
             tokio::fs::File
             tokio_util::either::Either<L, R>
             tokio_util::io::sink_writer::SinkWriter<S>
           and 26 others
note: required by a bound in `copy_bidirectional`
  --> /home/mario/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/io/util/copy_bidirectional.rs:75:20
   |
72 | pub async fn copy_bidirectional<A, B>(a: &mut A, b: &mut B) -> Result<(u64, u64), std::io::Error>
   |              ------------------ required by a bound in this function
...
75 |     B: AsyncRead + AsyncWrite + Unpin + ?Sized,
   |                    ^^^^^^^^^^ required by this bound in `copy_bidirectional`

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `localtunnel-server` (lib) due to 31 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `localtunnel v0.1.2`, intermediate artifacts can be found at `/tmp/cargo-install4BlL2K`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

thanks in advance

koakh commented 1 year ago

UPDATE:

I clone the project, and build it and it works out of the box, sorry for the issue.....but can be useful for others

❯ cargo build
   ...
   Compiling zstd v0.11.2+zstd.1.5.2
   Compiling actix-http v3.2.2
   Compiling actix-web v4.2.1
   Compiling tokio-native-tls v0.3.0
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.11
   Compiling localtunnel-server v0.1.2 (/tmp/rlt/server)
   Compiling localtunnel-client v0.1.2 (/tmp/rlt/client)
   Compiling localtunnel v0.1.2 (/tmp/rlt/cli)
    Finished dev [unoptimized + debuginfo] target(s) in 1m 29s

target/debug/localtunnel --version
[2023-09-13T17:21:02Z INFO  localtunnel] Run localtunnel CLI!
localtunnel 0.1.2

thanks

gdesmott commented 5 months ago

I fixed this in https://github.com/kaichaosun/rlt/pull/31