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
1 answer

Why compiler says that argument doesn't implement required traits?

I started learning Rust language for a while ago and now I am working on implementing a websocket server for a personal project. With this said, I am not a professional Rust programmer and I am still in the phase of learning the basics. I develop…
Bora
  • 1,778
  • 4
  • 17
  • 28
0
votes
1 answer

Whenever I open Hyper on Mac, my screen flashes black for a few seconds

I try to use Hyper on my Mac, and it used to work fine. For the last few weeks, my screen would flash black whenever I opened Hyper on my Mac (but not for regular terminal). Is this because I messed up some files? I recently got this Mac so I'm not…
anshul
  • 2,431
  • 2
  • 10
  • 22
0
votes
1 answer

Python hyper HTTP20Connection is sending DATA in 1024 byte chunks

I'm trying to send some HTTP/2 data with hyper 0.7.0 as the client. The data is getting chunked into 1024 byte segments before being sent to the server (much to my chagrin). As I look through the HTTP/2 SETTINGs packets I don't see anything that…
Rusty Lemur
  • 1,697
  • 1
  • 21
  • 54
0
votes
0 answers

How to echo client certificate of request?

I am writing a simple TLS/HTTP server using hyper and rustls. I want to be able to echo the details of a request to the server by displaying information like tls version, extensions, headers, and body. However, I'm not sure how I would be able to…
omgpopstar
  • 97
  • 5
0
votes
1 answer

What single type can refer to hyper HttpConnector and HttpsConnector?

Hyper's HttpConnector and hyper_tls's HttpsConnector clearly implement a common trait (or traits). I've studied their implementations and I haven't been able to come up with the right type (or alias) that would allow me to pass instances of either…
0
votes
1 answer

What is the best way to send a specific number of bytes in a hyper response?

I'm looking to send a specific number of bytes (e.g. 1GB) as a non-chunked response in a hyper server I'm making. I'm new to Rust and figured I could just the Rust equivalent of byte slice but that hasn't been working. Wondering what is the best way…
omgpopstar
  • 97
  • 5
0
votes
0 answers

iterate over large tsv.gs from network url

I would like to iterate over some network files (tsv.gz), parse them (load each row), and only write portions (i.e. columns) to files, i.e. https://datasets.imdbws.com/ (ideally with flate2), but I can't seem to find any idioms for iterating over…
Dan Jenson
  • 961
  • 7
  • 20
0
votes
0 answers

TLS-Enabled Server with Futures?

I cannot find a TLS-enabled server framework that does not require me to use a threaded, TcpStream, std::io::Read/std::io::Write-model for handling HTTP requests and responses (instead of a Future-oriented model). I think I found all the scattered…
springworks00
  • 104
  • 15
0
votes
0 answers

How can I mutate the HTML inside a hyper::Response?

I am trying to parse and modify the HTML data contained within a hyper::Response from the hyper HTTP crate: async fn modify_response(response: ResponseFuture) -> Result, hyper::Error> { let response = response.await; …
springworks00
  • 104
  • 15
0
votes
2 answers

How to convert hyper's Body stream into a Result>?

I'm updating code to the newest versions of hyper and futures, but everything I've tried misses implemented traits in some kind or another. A not working example playground for this ... extern crate futures; // 0.3.5 extern crate hyper; //…
Markus
  • 512
  • 1
  • 4
  • 21
0
votes
1 answer

How to plot AUC for best hyper parameters through grid search

I am using below code to get best hyper parameter which will give the maximum AUC value through grid search. but i am not able to plot it. model = KNeighborsClassifier() #Hyper Parameters Set params = {'n_neighbors':[5,10,15,20,25,30,35], …
Saikat
  • 1
  • 1
0
votes
1 answer

Async method with a closure containing an async block cannot infer an appropriate lifetime

I'm trying to make a small HTTP router using hyper, but I'm having some difficulties starting the server. The following function is where I'm having trouble. Dependencies: [dependencies] hyper = "0.13" tokio = { version = "0.2", features = ["full"]…
Jtplouffe
  • 11
  • 2
0
votes
1 answer

Hyper doc discrepancy with async in the call to make_service_fn

I know async is new in rust, the Hyper example shows, let make_svc = make_service_fn(|_conn| { async { Ok::<_, Infallible>(service_fn(hello)) } }); But the docs show, let make_svc = make_service_fn(|_conn| async { Ok::<_,…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
0
votes
0 answers

How do I write HTTP handlers using hyper?

I am trying to write a simple REST server using hyper: pub struct APIServer{ port: u16, memtable: RwLock } #[derive(Deserialize, Debug)] pub struct KeyValuePair { key : String, value : String, } impl APIServer { pub…
Nimrodshn
  • 859
  • 3
  • 13
  • 29
0
votes
1 answer

How do I split up data from a hyper JSON body so I have a hashmap with multiple keys and values?

I've managed to extract data from a POST method in hyper using the following: use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Method, Request, Response, Server}; use std::convert::Infallible; use std::net::SocketAddr; use…
max89
  • 443
  • 5
  • 18