Questions tagged [hyper]

A fast and correct HTTP implementation for Rust.

Hyper is a fast, safe HTTP implementation written in and for Rust.

  • A Client for talking to web services.
  • A Server for building those web services.
  • Blazing fast* thanks to Rust.
  • High concurrency with non-blocking sockets.
  • HTTP/1 and HTTP/2 support.

Github Repository

Guide

256 questions
0
votes
0 answers

Hyper v0.14 : http2 error: stream error sent by user: unexpected internal error encountered

hyper::Client.request() occationally raises the following error in my http reverse proxy when forwarding an HTTP2 request. http2 error: stream error sent by user: unexpected internal error encountered I am trying to find the cause of this error in…
Mr.Wang from Next Door
  • 13,670
  • 12
  • 64
  • 97
0
votes
1 answer

How to create rustls connection without performing a dns lookup

I already have the IP for a domain but I want to perform an HTTPS requests. I opted to go with rustls, however its documentation only shows an example which (presumably) performs a DNS lookup. I already know the IP I wish to point to. So I want to…
Calder White
  • 1,287
  • 9
  • 21
0
votes
0 answers

How to handle requests from other server on hyper Rust?

I have 2 servers: main and server, which resolve one API method. main server: #[tokio::main] pub async fn main() -> Result<(), Box> { let addr = SocketAddr::from(([127, 0, 0, 1], 3002)); let listener =…
0
votes
0 answers

Rust hyper decoding the response

I am trying to learn web development in rust .And wrote very basic code.Which fetch the data from the url and print the response in log and then returns the response to the service. If you run the below code String::from_utf8 will complain the utf8…
puja
  • 31
  • 3
0
votes
1 answer

How to use the body of a `hyper::Request` without consuming it?

I am trying to read request body using (req.into_body()) and generate a hash key based on parameters (request.uri and request.body) but as documentation states req.into_body() will consume request so I can't use the same variable below that…
nil96
  • 313
  • 1
  • 3
  • 12
0
votes
0 answers

How to extract client certificate in Rust's hyper crate?

I'm looking at this example and I'm trying to understand how to read the client certificate to extract subject from it. There is a make_service_fn function that processes requests, which is called first. It would technically be possible to extract…
user7487097
0
votes
0 answers

Can't do sudo root command on cmd with linux iso file

Hello do you have any idea from where i can download an ubuntu iso ltsc file that is not corrupt,i tried to download it from the ubuntu site,but the 22.04 version iso file doesn't seem to work on hyper v.Do you have any idea from where i can get an…
0
votes
1 answer

How do I fix type annotations needed for `&Target` error for rust's hyper make_service_fn

My 20th day learning Rust and I try to code a reverse proxy that can authenticate. Got error in line 30: error[E0282]: type annotations needed for &Target. I tried to follow the help by compiler "consider giving this closure parameter an explicit…
0x75aaa
  • 45
  • 6
0
votes
0 answers

Creating a HTTP proxy to handle mTLS connections with Hyper

I need some help to create a proxy in hyper that resolves a mTLS connection. I used this example https://github.com/hyperium/hyper/blob/0.14.x/examples/http_proxy.rs as a starting point, and worked through adding tokio-rustls to support the mTLS…
0
votes
0 answers

Failed to resolve import "./schemas" from "sanity.config.ts". Does the file exist

I tried removing the dot and / but still nothing is happening. [screenshot1 i think the file is in the wrong location. but i dont know where should it be.
0
votes
0 answers

packer error Failed to send shutdown command: dial tcp 172.29.48.100:22: i/o timeout

I am trying packer builder with provisioner "shell-local". After successful OS installation I am trying to attach second network adapter. But it stuck in this error. Platform Hyper-V. Code looks like: source "hyperv-iso" "build-debian" { …
robotiaga
  • 315
  • 2
  • 11
0
votes
0 answers

unknown import: `wasi_snapshot_preview1::sock_setsockopt` has not been defined when running Rust WASI binary

Title says it all - I am attempting to run a very basic Rust program using hyper_wasi, and everything compiles seemingly ok using cargo wasi run. Unfortunately when it actually executes, I get: Error: failed to run main module…
Chris Shain
  • 50,833
  • 6
  • 93
  • 125
0
votes
1 answer

How can I return custom headers but no body? Using Hyper in Rust

What I want to do is return headers in hyper but without returning a body as such. My code currently is this: use std::{convert::Infallible, net::SocketAddr}; use hyper::{Body, Request, Response, Server}; use hyper::service::{make_service_fn,…
DFG
  • 31
  • 1
  • 13
0
votes
0 answers

Creating a script in a hyper application

I want to make an executable script for the HYPER application, just like .bat on windows, but how can I make hyper run when I open it? Example: python main.py
Reloxe
  • 11
  • 3