Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hyper example #9

Closed
wants to merge 2 commits into from

Conversation

najamelan
Copy link

As there were several issues about this, and people seem to particularly like this example, I updated it so it works again. This should close #5, rust-lang/futures-rs#1462.

There is another issue though that does not get resolved here. This example demonstrates how to asynchronously fetch a different website to return the response to hyper. However the chosen url is particularly poor: http://www.rust-lang.org/en-US/.

  1. This does a 301 redirect to https. So we just send that back and the browser url bar changes from 127.0.0.1 to https://www.rust-lang.org/en-US/, which is a bit confusing, and I think not the intention of the example.
  2. The final https url returns a 404...

I tried to send it to the main page of rust-lang.org in https, but hyper::Client does not seem to support https out of the box. I think it would be best to replace the url with some good example page that does not redirect to https, but I couldn't find one immediately. I also created an examples branch which has the working example as proof it works. I will make a pull request, but I don't know if having examples in this repository is desirable.

@cramertj
Copy link
Member

Superseded by #18

@cramertj cramertj closed this Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error building Applied: HTTP Server example
2 participants