actix / examples

Community showcase and examples of Actix Web ecosystem usage.
Apache License 2.0
3.7k stars 807 forks source link

SSL not supported in http-proxy #96

Closed heibor closed 5 years ago

heibor commented 5 years ago

When I run the http-proxy example, I used curl http://127.0.0.1:8080/streaming, I got an error message: ERROR 2019-03-28T09:34:05Z: actix_web::pipeline: Error occurred during request handling, status: 502 Bad Gateway Failed to connect to host: SSL is not supported INFO 2019-03-28T09:34:05Z: actix_web::middleware::logger: 127.0.0.1:52863 "GET /streaming HTTP/1.1" 502 0 "-" "curl/7.54.0" 0.001003

Is there something I missing?

fafhrd91 commented 5 years ago

Did you enable ssl feature?

heibor commented 5 years ago

How to enable the ssl feature? modify the code ? or modify the Cargo.toml?

DoumanAsh commented 5 years ago

See how to choose features in Cargo.toml https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#choosing-features

We have free separate SSL related features: https://github.com/actix/actix-web/blob/0.7/Cargo.toml#L34-L44

heibor commented 5 years ago

Thank you, I solved my question by change actix-web = "^0.7" to actix-web = { version = "^0.7", features=["ssl"] }.

esemeniuc commented 4 years ago

See https://github.com/actix/actix-web/blob/master/examples/client.rs for how to use SSL with modern Actix