#poem #proxy #poem-web #async #http-proxy #web-framework #web

poem-reverse-proxy

A simple proxy endpoint compatible with the Poem web framework

1 unstable release

0.0.0 Apr 13, 2024

#17 in #poem-web

MIT license

23KB
191 lines

Poem Proxy

This crate provides an endpoint for the poem web framework which transfers data to and from another server

Number of Stars Number of Issues License License License Published Version

Development Roadmap

While this project is in work, I will be following this development roadmap. In the end, poem-proxy will be a versatile service that is ready for your next web application. It is not quite there yet - but it is on its way!

  • Create a proxy that can forward http requests to another server and send its response back
    • Get requests
    • Post requests
    • Put requests
    • Patch
    • Delete
    • Ensure all necessary information is captured
  • Add websocket support to the proxy endpoint
    • Ensure all necessary information is captured
  • Allow finer configuration of the proxy endpoint
    • Http/Https
    • Ws/Wss
    • Forward to different target servers
  • Enable a templating engine that will allow the proxy to fill information in that the proxied server might not know
    • Templating for request
      • Headers
      • Body
      • Other parts
    • Templating for response
      • Headers
      • Body
      • Other parts
    • Templating for websocket communications
  • Ensure that proxy is implemented properly with non-advocate code review
  • Write comprehensive tests to ensure functionality is not lost
  • Write comprehensive documentation that shows clear examples of how to use the proxy
  • Set up CI to ensure codebase stays relevant even after development is complete

As you can see, this proxy service is not yet fully functional. The items checked off have been tested and do work to some limited capacity.

About

Purpose

Poem-proxy is a sub-project of Parrhesia. It is meant to facilitate a seamless user experience for front-end development without needing to route internet traffic to multiple backend servers. Instead, all connections can be sent to the Rust backend, which will sort through and forward any necessary requests.

Parrhesia will officially support Sveltekit as the front-end framework of choice, and even today this proxy endpoint can handle all its basic functionality. Even Hot-Module-Reloading, which is a massive boost to the development experience.

Documentation

Documentation is also in work, and can be found here. Just remember that it's a work-in-progress. Parhesia is nowhere near completion, but you can check out that repository to see how this endpoint is currently being used.

Contributing

Due to the small scale of this project, code contributions really aren't currently needed. That being said, I am in need of people knowledgable with proxies to review my work and ensure it is correct and follows today's proxy standards. In addition, please create issues if you come across any bugs or have any other ideas on how this proxy can be improved.

License

This code is licensed under the MIT License. If you make improvements, please consider contributing them back to main. You are completely free to use this code and this library for any purpose. Anything you contribute shall be licensed as MIT, without additional terms or conditions.

Dependencies

~16–28MB
~452K SLoC