Closed gitmalong closed 11 months ago
I found some trace logs from the server.
Server debug logs
[2023-10-05T23:03:42Z TRACE tracing::span] -- connect;
[2023-10-05T23:03:42Z TRACE tracing::span] -- connect;
Server listening on 127.0.0.1:50051
[2023-10-05T23:03:45Z TRACE tracing::span] server_handshake;
[2023-10-05T23:03:45Z TRACE tracing::span::active] -> server_handshake;
[2023-10-05T23:03:45Z TRACE h2::codec::framed_write] FramedWrite::buffer; frame=Settings { flags: (0x0), initial_window_size: 1048576, max_frame_size: 16384, max_header_list_size: 16777216 }
[2023-10-05T23:03:45Z TRACE tracing::span::active] -> FramedWrite::buffer;
[2023-10-05T23:03:45Z DEBUG h2::codec::framed_write] send frame=Settings { flags: (0x0), initial_window_size: 1048576, max_frame_size: 16384, max_header_list_size: 16777216 }
[2023-10-05T23:03:45Z TRACE h2::frame::settings] encoding SETTINGS; len=18
[2023-10-05T23:03:45Z TRACE h2::frame::settings] encoding setting; val=InitialWindowSize(1048576)
[2023-10-05T23:03:45Z TRACE h2::frame::settings] encoding setting; val=MaxFrameSize(16384)
[2023-10-05T23:03:45Z TRACE h2::frame::settings] encoding setting; val=MaxHeaderListSize(16777216)
[2023-10-05T23:03:45Z TRACE h2::codec::framed_write] encoded settings rem=27
[2023-10-05T23:03:45Z TRACE tracing::span::active] <- FramedWrite::buffer;
[2023-10-05T23:03:45Z TRACE tracing::span] -- FramedWrite::buffer;
[2023-10-05T23:03:45Z TRACE tracing::span] flush;
[2023-10-05T23:03:45Z TRACE tracing::span::active] <- server_handshake;
[2023-10-05T23:03:45Z TRACE tracing::span::active] -> server_handshake;
[2023-10-05T23:03:45Z TRACE h2::server] state=Flushing(_)
[2023-10-05T23:03:45Z TRACE tracing::span::active] -> flush;
[2023-10-05T23:03:45Z TRACE tracing::span] FramedWrite::flush;
[2023-10-05T23:03:45Z TRACE tracing::span::active] -> FramedWrite::flush;
[2023-10-05T23:03:45Z TRACE h2::codec::framed_write] queued_data_frame=false
[2023-10-05T23:03:45Z TRACE h2::codec::framed_write] flushing buffer
[2023-10-05T23:03:45Z TRACE tracing::span::active] <- FramedWrite::flush;
[2023-10-05T23:03:45Z TRACE tracing::span] -- FramedWrite::flush;
[2023-10-05T23:03:45Z TRACE tracing::span::active] <- flush;
[2023-10-05T23:03:45Z TRACE h2::server] flush.poll=Ready
[2023-10-05T23:03:45Z TRACE tracing::span] read_preface;
[2023-10-05T23:03:45Z TRACE tracing::span] -- flush;
[2023-10-05T23:03:45Z TRACE tracing::span::active] -> read_preface;
[2023-10-05T23:03:45Z DEBUG h2::server] connection error PROTOCOL_ERROR -- read_preface: invalid preface;
[2023-10-05T23:03:45Z TRACE tracing::span::active] <- read_preface;
[2023-10-05T23:03:45Z TRACE tracing::span::active] <- server_handshake;
[2023-10-05T23:03:45Z TRACE tracing::span] -- server_handshake;
[2023-10-05T23:03:45Z DEBUG hyper::server::server::new_svc] connection error: http2 error: connection error detected: unspecific protocol error detected
[2023-10-05T23:03:45Z TRACE tracing::span] -- read_preface;
[2023-10-05T23:03:45Z TRACE tracing::span] -- server_handshake;
Adding https://crates.io/crates/tonic-web seems to help but now I get
Access to fetch at 'http://127.0.0.1:50051/myapp.GrpcStorage/Settings' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Hi!
I have a local CSR WASM browser app (based on https://github.com/leptos-rs/leptos/tree/main/examples/tailwind_csr_trunk ) that should connect to a local GRPC backend.
I verified that my grpc server is running and made some manual requests with help of
grpcui
:grpcui --plaintext localhost:50051
However the request from my WASM app fails.
Request in CURL format from Chrome:
Maybe the request is getting malformed ?!