warp
warp copied to clipboard
Adds a very basic proxy server example
As a new user of warp I struggled a bit while writing a small proxy server.
Specifically the combination of warp::method
, warp::path::full
, warp::header::headers_cloned
and warp::body::bytes
to gain access to all the request information i need was not obvious to me. So after figuring it out (with the help of your discord) i wanted to contribute this example.
Please let me know if you have any issues with the code :)
Looks useful to me. I don't know what you guys think about this, but I always miss some testing on the sample files, I was also about to open a PR adding some testing to the examples, or at least one testing example by itself.
Also I don't understand why deny warnings on the examples (not only yours).
Thanks!
Looks useful to me.
Great :)
I don't know what you guys think about this, but I always miss some testing on the sample files, I was also about to open a PR adding some testing to the examples, or at least one testing example by itself.
True. I really like that rocket has tests for most (or all?) examples in the repo. That being said though, in this example it is quite hard to write meaningful tests because it depends an an external service. You got any ideas on how to test this?
Also I don't understand why deny warnings on the examples (not only yours).
I simply used it because it is also present on all the other tests and i wanted to stick to the same style. As i could not find any contributing or style guidelines :)
Thanks for the feedback!
Cool, thanks for submitting! The example seems simple and useful to learn from. Happy to add this.
Thanks for the great response. Really helped me in better understanding warp and improving the example.