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
2 answers

Why do I get the error "wrong number of type arguments" when I use hyper::Client in my method signature?

I want to get a hyper::Client configured according to the URL scheme. For that, I created a small method: extern crate http; // 0.1.8 extern crate hyper; // 0.12.7 extern crate hyper_tls; // 0.1.4 use http::uri::Scheme; use hyper::{Body, Client,…
Riduidel
  • 22,052
  • 14
  • 85
  • 185
0
votes
1 answer

zsh + Hyper.js + Windows 10 = blue font?

I've got a problem where my Hyper terminal emulator keeps changing my zsh shell text to blue. This doesn't happen on WSL. WSL: Hyper.js: Changing hyper.js 'cyan' to #FFFFFF obviously makes it white but I don't want to fix it that way. For some…
b0nes
  • 103
  • 1
  • 7
0
votes
1 answer

Implementing hyper::Service on a reference to a struct

I'm trying to make a question and answer server for a huge data structure. The user would send JSON questions to the server and the server would use the huge data structure to answer. I'm trying to do this by implementing the hyper::server::Service…
0
votes
1 answer

Can I reuse a Tokio Core and a Hyper Client in Rocket?

I want to make a client request with Hyper 0.11 after I get an incoming request from a user which I handle with rocket and use as few resources as possible. If I can't reuse the Core or the Client, I would have to create them each time Rocket…
Kilian Hertel
  • 166
  • 1
  • 14
0
votes
1 answer

Cannot send ALPN request to APNS with python 3.5 and Hyper

I am trying to implement APNS service on my Python REST server with Hyper. Since APNS now require HTTP/2 (ALPN) protocol, I was not able to get_response() from Hyper connection. It throws the below error. Traceback (most recent call last): File…
Vincent Lam
  • 151
  • 2
  • 2
  • 10
0
votes
0 answers

How to set the Content-Length header in multiple routes using Nickel middleware?

As I understand it, middleware handlers are not suitable for this since they work before processing the request. My current solution is: router.get("/items/:id", middleware! { |request, mut response| // ... let data =…
Ilya
  • 51
  • 6
0
votes
1 answer

How to set raw headers in Hyper at runtime?

I'm trying to set headers on a Hyper Response at runtime. In the real code, the headers come from a file so I don't know what they are at compile-time. Unfortunately, I've dug through documentation and all the examples I could find but haven't…
Ndesmic
  • 57
  • 6
0
votes
1 answer

Nickel server using Let's Encrypt certificate has a handshake error when accessed with rustls

I'm trying to create a small REST-like API that should be secured with HTTPS. I want to use the nickel crate for the server and hyper_rustls and hyper for the client. The server is running great as long as I use a browser, curl or a REST client to…
f4bi4n
  • 13
  • 1
  • 4
0
votes
1 answer

How do I start a web server in Rust with hyper?

I want to learn Rust by writing a reverse proxy with the hyper framework. My complete project is on GitHub. I'm stuck at starting a listener as explained in the documentation: extern crate hyper; use hyper::Client; use hyper::server::{Server,…
klausi
  • 491
  • 5
  • 17
0
votes
1 answer

How do I fix this lifetime issue?

In the code below, the string does not live long enough in the Into> implementation for RequestParameters<'a>. I understand why, since string comes into scope inside of into and is no longer in scope after the method finishes, but Body<'a>…
-1
votes
1 answer

How to connect to Redis from inside Docker container using redis-rs?

Code https://github.com/thiskevinwang/rust-redis-docker/tree/for-stackoverflow Context: Written in Rust Cargo.toml: [dependencies] redis = "0.16.0" hyper = "0.13" Local development ✅ Things that work: running a redis docker container…
Kevin Wang
  • 644
  • 1
  • 8
  • 20
-1
votes
1 answer

How can I use a Hyper client from a gRPC function?

I have a gRPC server and need to make a HTTP GET. I'm struggling getting the futures right in the calls. I'm trying this fn current( &self, _: ::grpc::RequestOptions, p: quote::CurrentRequest, ) ->…
Fredrik Jansson
  • 3,764
  • 3
  • 30
  • 33
-1
votes
1 answer

How to sort an array (large N) that is populated with lists in the FASTest way possible?

I am in need of a HYPER efficient sort algorithm. The built in Python .sort and sorted are fast, but not fast enough for my task. Likewise, I cannot use numpy.sort() because I need to sort an array (filled with lists). I cannot seem to find a GitHub…
-1
votes
1 answer

Start a thread in one web service request and stop it in another request

I would like to start a thread which records sensor values thanks to a web service request using Hyper.rs. Then, with another request, I would like to stop the thread and take all recorded data. I know if a thread is already running thanks to Mutex,…
-1
votes
3 answers

Why does nothing happen after matching on a request's path in hyper?

I am trying to read POSTed JSON using hyper 0.11.2. I don't see anything happening after "Reached" is printed. fn call(&self, req: hyper::server::Request) -> Self::Future { let mut response: Response = Response::new(); match (req.method(),…
BalaB
  • 3,687
  • 9
  • 36
  • 58
1 2 3
17
18