Skip to content
/ rama Public

modular service framework to move and transform network packets

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

plabayo/rama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

rama banner

Crates.io Docs.rs MIT License Apache 2.0 License rust version Build Status Lines of Code

πŸ¦™ ramaβ„’ (γƒ©γƒž) is a modular service framework for the πŸ¦€ Rust language.

It gives you programmable control over how packets move through your stack, so you can build:

  • production grade reverse and forward proxies
  • HTTP and TLS termination layers
  • security inspection and distortion proxies
  • high volume scraping and data extraction pipelines
  • custom HTTP clients with deep control over the wire

rama is already used in production by companies at scale for use cases such as network security, data extraction, API gateways and routing.

Tip

πŸ“– New to rama

  1. Read the "Why rama" chapter for background.
  2. Run one of the examples.
  3. Use the rama book and edge Rust docs as reference while building your own stack.

Whether you're intercepting traffic for security analysis, writing a web service, emulating clients with custom user agents, hijacking connections for advanced testing, or building high-performance proxies, rama provides a clean and composable Tokio-native foundation to program network services in Rust.

It's not just a toolkitβ€”it's a mindset shift for how to design and operate dynamic, programmable network services.

Network protocols supported and implemented by rama allow you to build servers, clients and proxies.

GitHub Sponsors Buy Me A Coffee Paypal Donation Discord

Tip

πŸ’¬ Come join us at Discord on the #rama public channel. To ask questions, discuss ideas and ask how rama may be useful for you.

Read further below or skip to one of the following chapters instead:

Who is rama for

  • Developers and teams who want fine grained control over transport, TLS and HTTP while staying in safe Rust.
  • Organisations that need a long term partner to:
    • maintain and evolve a proxy or network platform
    • build custom features on top of rama
    • get support and training for internal teams

rama ships with batteries included for transports, HTTP, TLS, DNS, proxy protocols, telemetry, fingerprinting and more.

The table below shows the current state of the ecosystem to use or build upon, next to the middleware, services and stacks you'll build yourself:

category support list
βœ… transports βœ… tcp βΈ± βœ… udp βΈ± βœ… Unix (UDS) βΈ± βœ… middleware
βœ… http βœ… auto βΈ± βœ… http/1.1 βΈ± βœ… h2 βΈ± πŸ—οΈ h3 (2) βΈ± βœ… middleware
βœ… web server βœ… fs βΈ± βœ… router βΈ± βœ… dyn router βΈ± βœ… static router βΈ± βœ… handler extractors βΈ± βœ… k8s healthcheck
βœ… client βœ… easy client βΈ± βœ… high level API βΈ± βœ… BoringSSL Connect βΈ± βœ… Rustls Connect βΈ± βœ… HTTP Proxy Connect βΈ± βœ… Socks5 Proxy Connect βΈ± ❌ Chromium Http (3)
βœ… tls βœ… Rustls βΈ± βœ… BoringSSL βΈ± ❌ NSS (3)
βœ… dns βœ… DNS Resolver
βœ… proxy protocols βœ… PROXY protocol βΈ± βœ… http proxy βΈ± βœ… https proxy βΈ± βœ… socks5(h) proxy
βœ… web protocols βœ… SSE βΈ± βœ… WS βΈ± ❌ Web Transport (3) βΈ± ❌ gRPC (3)
βœ… async-method trait services βœ… Service βΈ± βœ… Layer βΈ± βœ… extensions βΈ± βœ… dyn dispatch βΈ± βœ… middleware
βœ… telemetry βœ… tracing βΈ± βœ… opentelemetry βΈ± βœ… http metrics βΈ± βœ… transport metrics
βœ… Diagnostics βœ… curl export βΈ± βœ… HAR
βœ… upstream proxies βœ… MemoryProxyDB βΈ± βœ… Username Config βΈ± βœ… Proxy Filters
βœ… User Agent (UA) βœ… Http Emulation βΈ± βœ… Tls Emulation βΈ± βœ… UA Parsing
βœ… Fingerprinting βœ… Ja3 βΈ± βœ… Ja4 βΈ± βœ… Ja4H βΈ± βœ… Akamai passive h2 βΈ± βœ… Peetprint (tls)
βœ… utilities βœ… error handling βΈ± βœ… graceful shutdown βΈ± βœ… Connection Pooling βΈ± βœ… Tower Adapter βΈ± πŸ—οΈ IP2Loc (1)
πŸ—οΈ Graphical Interface πŸ—οΈ traffic logger (3) βΈ± πŸ—οΈ TUI implementation (3) βΈ± ❌ traffic intercept (3) βΈ± ❌ traffic replay (3)
βœ… binary βœ… prebuilt binaries βΈ± πŸ—οΈ proxy config (3) βΈ± βœ… http client βΈ± ❌ WASM Plugins (3)
πŸ—οΈ data scraping πŸ—οΈ Html Processor (3) βΈ± ❌ Json Processor (3)
❌ browser ❌ JS Engine (3) ⸱ ❌ Web API Emulation (3)

πŸ—’οΈ Footnotes

Starting from v0.3.0 we'll switch things up. Releases will be in frequent ~ 6 week release trains, with no more alpha releases in between.

For organisations

If your organisation relies on rama or plans to, we offer:

  • Support and maintenance contracts
    Help with upgrades, bug fixes and operational questions.
  • Feature development contracts
    Higher priority or extended scope features in rama itself.
  • Consulting and integration
    Design and implementation of proxies, scraping pipelines, security layers and other network services built on rama.
  • Training and knowledge transfer
    Workshops and mentoring so your team can become productive with rama and its ecosystem.

πŸ“© Contact us at hello@plabayo.tech to discuss your needs.

πŸ§ͺ | Experimental

πŸ¦™ rama (γƒ©γƒž) is to be considered experimental software for the foreseeable future. In the meanwhile it is already used in production by ourselves and others alike. This gives us real world feedback to improve the framework. If you run Rama in production, your feedback is very valuable. As such, if you use rama do let us know feedback over Discord, email or a GitHub issue.

Tip

Contact us at hello@plabayo.tech to arrange a service contract. Among other benefits, this allows you to request migration of rama versions within your own codebase and stay up to date without hassle, even when major releases introduce breaking changes. While these changes are typically minimal and mechanical, this service can be especially helpful for organisations that do not have the developer resources to handle them directly.

Proxies and other use cases

The primary focus of rama is to aid you in your development of proxies:

And pretty much any other kind of proxy, such as API Gateways. Is your usecase not yet supported sufficiently? Do let us know via Discord, email or a GitHub issue.

Tip

Check out the "Intro to Proxies" chapters in the rama book to learn more about the different kind of proxies. It might help in case you are new to developing proxies.

The Distortion proxies support comes with User Agent (UA) emulation capabilities. The emulations are made possible by patterns and data extracted using rama-fp. The service is publicly exposed at https://fp.ramaproxy.org, made possible by our sponsor host https://fly.io/.

Public echo service

πŸ” https://echo.ramaproxy.org/ is another service publicly exposed. In contrast to the Fingerprinting Service it is aimed at developers and allows you to send any http request you wish in order to get an insight on the Tls Info and Http Request Info the server receives from you when making that request.

curl -XPOST 'https://echo.ramaproxy.org/foo?bar=baz' \
  -H 'x-magic: 42' --data 'whatever forever'

Feel free to make use of while crafting distorted http requests, but please do so with moderation. In case you have ideas on how to improve the service, please let us know by opening an issue. Using the rama binary you can also run both the echo and fp service yourself, locally or as an external facing web service.

The echo service also has websocket support to echo back your messages, similar to <echo.websocket.org>. As an extra it has support for subprotocols to uppercase (echo-upper) or lowercase (echo-lower) your messages. Default, including if none is requested is echo. Example that will open a TUI client:

rama wss://echo.ramaproxy.org

Learn more about the rama CLI at https://ramaproxy.org/book/deploy/rama-cli.html.

Please run your own echo service instead of using echo.ramaproxy.org in case you are planning to send a lot of traffic to the echo service.

BrowserStack sponsors rama by providing automated cross-platform browser testing on real devices, which uses the public fingerprinting service to aid in automated fingerprint collection on both the Http and Tls layers. By design we do not consider Tcp and Udp fingerprinting.

Next to proxies, rama can also be used to develop Web Services and Web Clients.

Note

rama also has a public channel on the official Discord of the tokio project. Feel free to join us there instead or as well: https://discord.com/channels/500028886025895936/1349098858831024209

rama binary

The rama binary allows you to use a lot of what rama has to offer without having to code yourself. It comes with a working http client for CLI, which emulates User-Agents and has other utilities. And it also comes with IP/Echo services.

It also allows you to run a rama proxy, configured to your needs.

Learn more about the rama binary and how to install it at https://ramaproxy.org/book/deploy/rama-cli.

Important

Learn more about the rama CLI code signing- and privacy policy at https://ramaproxy.org/book/deploy/rama-cli.html#code-signing. Applicable to MacOS and Windows platforms only.

πŸ“£ | rama ecosystem

For now there are only the rama crates found in this repository, also referred to as "official" rama crates.

We welcome however community contributions not only in the form of contributions to this repository, but also have people write their own crates as extensions to the rama ecosystem. E.g. perhaps you wish to support an alternative http/tls backend.

In case you have ideas for new features or stacks please let us know first. Perhaps there is room for these within an official rama crate. In case it is considered out of scope you are free to make your own community rama crate. Please prefix all rama community crates with "rama-x", this way the crates are easy to find, and are sufficiently different from "official" rama crates".

Once you have such a crate published do let us know it, such that we can list them here.

πŸ“¦ | rama crates

The rama crate can be used as the one and only dependency. However, as you can also read in the "DIY" chapter of the book at https://ramaproxy.org/book/diy.html#empowering, you are able to pick and choose not only what specific parts of rama you wish to use, but also in fact what specific (sub) crates.

Here is a list of all rama crates:

rama crates that live in https://github.com/plabayo/rama-boring (forks of cloudflare/boring):

repositories in function of rama that aren't crates:

Repositories that we maintain and are re exported by the root rama crate:

🌐 | Web Services

Tip

See all HTTP(S) server examples at:

https://github.com/plabayo/rama/tree/main/examples#http-servers-and-services

On that README you also find other kind of server examples listed.

Developing proxies are the primary focus of rama (γƒ©γƒž). It can however also be used to develop any kind of web service you wish. Be it dynamic endpoints, serving static data, websockets, SSE or Datastar. rama does it all. This comes with many of the same benefits that you get when developing proxies using rama:

  • Use Async Method Traits;
  • Reuse modular middleware;
  • Have the ability to be in full control of your web stack from Transport Layer (Tcp, Udp) through Tls and Http/Ws;
  • If all you care about is the Http layer then that is fine too.
  • Be able to trust that your incoming Application Http data has not been modified (e.g. Http header casing and order is preserved);
  • Easily develop your service at a Request layer and High level functions alike, choices are yours and can be combined.

Even when building proxies a (local/private) web service can often still be useful, for example:

  • a k8s health service (/examples/http_k8s_health.rs);
  • a metric exposure service;
  • a minimal api service (e.g. to expose device profiles or certificates);
  • a Graphical Interface / control panel;

Tip

πŸ“– Learn more about developing web services in the rama book: https://ramaproxy.org/book/web_servers.html.

Next to https clients you can use any other protocol supported by Rama as a client.

Datastar

Datastar helps you build reactive web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.

β€” https://data-star.dev/

rama has built-in support for πŸš€ Datastar. You can see it in action in Examples:

rama rust docs:

Shuttle

Crates.io Docs.rs

Shuttle is a Rust-native cloud development platform that lets you deploy your app while also taking care of all of your infrastructure. rama is one of a series of frameworks that is officially supported by Shuttle as part of their official SDK crates.

Learn more about what shuttle is and how to deploy services built with rama on our Shuttle docs.

πŸ§‘β€πŸ’» | Web Clients

In The rama book you can read and learn that a big pillar of rama's architecture is built on top of the Service concept. A Service takes a Request, and uses it to serve either a Response or Error. Such a Service can produce the response "directly" (also called ☘️ Leaf services) or instead pass the request to an inner Service which it wraps around (so called πŸ” Middlewares).

It's a powerful concept, originally introduced to Rust by the Tower ecosystem and allows you build complex stacks specialised to your needs in a modular and easy manner. Even cooler is that this works for both clients and servers alike.

rama provides an EasyHttpWebClient which sends your Http Request over the network and returns the Response if it receives and read one or an Error otherwise. Combined with the many Layers (middleware) that rama provides and perhaps also some developed by you it is possible to create a powerful Http client suited to your needs.

As a πŸ’ cherry on the cake you can import the HttpClientExt trait in your Rust module to be able to use your Http Client Service stack using a high level API to build and send requests with ease.

Tip

An end-to-end tested http client example can be found at: /examples/http_high_level_client.rs.

πŸ’ͺ | Performance

Here's a list of external benchmarks:

Please open an issue or Pull Request (PR) in case you are aware of any other benchmarks of interest in regards to servers, clients or proxies.

⛨ | Safety

The Rama crates avoid unsafe code as much as possible, and use it only where there is no reasonable alternative. The boring crates contain FFI bindings and the rama-http-core deals with low level primitives. These are examples of crates with more unsafe than others. Do contact us if you see opportunity for even less unsafe code than what we already have.

We also make use of cargo vet to audit our supply chain.

πŸ¦€ | Compatibility

Tier 1 Platforms

rama (γƒ©γƒž) is developed mostly on MacOS M-Series and Windows 11 x64 machines. Most organisations running rama in production do so on a variety of Linux systems. These are tier 1 platforms.

platform tested test platform
MacOS βœ… MacOS 15 Apple Silicon: developer machine + GitHub Action
Linux βœ… AMD x64 developer machine with Ubuntu 25 + GitHub Action (Ubuntu 24.04)
Windows βœ… Windows 11 AMD x64 developer machine + GitHub Action (Windows latest (x64))

Android and iOS should work for the most part, but are currently not tested holistically. rama-boring and friends are already tested in CI on these mobile platforms. rama itself not yet.

Other Platforms

Please open a ticket in case you have compatibility issues for your setup/platform. Our goal is not to support all possible platforms in the world, but we do want to support as many as we reasonably can. Such platforms will only happen and continue to happen with community/ecosystem support.

Minimum supported Rust version

rama's MSRV is 1.91.

Using GitHub Actions we also test if rama on that version still works on the stable and beta versions of rust as well.

🧭 | Roadmap

Please refer to https://github.com/plabayo/rama/milestones to know what's on the roadmap. Is there something not on the roadmap for the next version that you would really like? Please create a feature request to request it and become a sponsor if you can.

We also provide special-purpose feature development contracts for commercial organisations which require a feature beyond the planned scope or to have it developed with priority. Contact us at email if you have a need for this

πŸ“° | Media Appearances

rama (0.2) was featured in a πŸ“» Rustacean episode on the 19th of May 2024, and available to listen at https://rustacean-station.org/episode/glen-de-cauwsemaecker/. In this episode Glen explains the history of rama, why it exists, how it can be used and more.

On the 19th of August 2025 we released the first episode of Netstack.FM, a new podcast about networking, Rust and everything in between. In the first episode we went over the origins of Glen, rama and why the podcast was created.

rama is also frequently featured in newsletters such as https://this-week-in-rust.org/.

πŸ’Ό | License

This project is dual-licensed under both the MIT license and Apache 2.0 License.

πŸ‘‹ | Contributing

🎈 Thanks for your help improving the project! We are so happy to have you! We have a contributing guide to help you get involved in the rama project.

Contributions often come from people who already know what they want, be it a fix for a bug they encountered, or a feature that they are missing. Please do always make a ticket if one doesn't exist already.

It's possible however that you do not yet know what specifically to contribute, and yet want to help out. For that we thank you. You can take a look at the open issues, and in particular:

  • good first issue: issues that are good for those new to the rama codebase;
  • easy: issues that are seen as easy;
  • mentor available: issues for which we offer mentorship;
  • low prio: low prio issues that have no immediate pressure to be finished quick, great in case you want to help out but can only do with limited time to spare;

In general, any issue not assigned already is free to be picked up by anyone else. Please do communicate in the ticket if you are planning to pick it up, as to avoid multiple people trying to solve the same one.

Note

Some issues have a needs input label. These mean that the issue is not yet ready for development. First of all prior to starting working on an issue you should always look for alignment with the rama maintainers. However these needs input issues require also prior R&D work:

  • add and discuss missing knowledge or other things not clear;
  • figure out pros and cons of the solutions (as well as what if we choose to not resolve the issue);
  • discuss and brainstorm on possible implementations, desire features, consequences, benefits, ...

Only once this R&D is complete and alignment is confirmed, shall the feature be started to be implemented.

Should you want to contribute to this project but you do not yet know how to program in Rust, you could start learning Rust with as goal to contribute as soon as possible to rama by using "the Rust 101 Learning Guide" as your study companion. Glen can also be hired as a mentor or teacher to give you paid 1-on-1 lessons and other similar consultancy services. You can find his contact details at https://www.glendc.com/.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in rama by you, shall be licensed as both MIT and Apache 2.0, without any additional terms or conditions.

Acknowledgements

Special thanks goes to all involved in developing, maintaining and supporting the Rust programming language, the Tokio ecosystem and all other crates that we depend upon. This also includes Hyper and its ecosystem as without those projects rama would not be. The core http module of rama is a specialised fork of hyper and use the underlying h2 and h3 crates as dependencies.

Extra credits also go to Axum, from which ideas and code were copied as it's a project very much in line with the kind of software we want rama to be, but for a different purpose. Our hats also go off to Tower, its inventors and all the people and creatures that help make it be every day. The service concept is derived from Tower and many of our layers are a Tower fork, adapted where required or desired.

An extra big shoutout goes also to the online communities surrounding and part of these ecosystems. They are a great place to hangout and always friendly and helpful. Thanks.

πŸ’– | Sponsors

rama is completely free, open-source software which needs lots of effort and time to develop and maintain.

You can become a regular financial contributor to rama by paying for a monthly subscription at Github Sponsors. One time contributions are possible as well.

Sponsors help us continue to maintain and improve rama, as well as other Free and Open Source (FOSS) technology. It also helps us to create educational content such as https://github.com/plabayo/learn-rust-101, and other open source libraries such as https://github.com/plabayo/tokio-graceful and https://venndb.plabayo.tech.

Next to the many unpaid developer hours we put in a project such as rama, we also have plenty of costs, such as services ranging from hosting to Docker, but also tooling for developers and automated processing. All these costs money.

Sponsors receive perks and depending on your regular contribution it also allows you to rely on us for support and consulting.

Finally, you can also support us by shopping Plabayo <3 γƒ©γƒž merchandise πŸ›οΈ at https://plabayo.threadless.com/.

Plabayo's Store With rama Merchandise

rama Sponsors

We would like to extend our thanks to the following sponsors for funding rama (γƒ©γƒž) development. If you are interested in becoming a sponsor, you can do so by becoming a sponsor. One time payments are accepted at GitHub as well as at "Buy me a Coffee". One-time and monthly financial contributions are also possible via Paypal, should you feel more at ease with that at "Paypal Donations".

Donations can also be paid in the following cryptocurrency:

  • Bitcoin: bc1qk3383nfzcag9lymwv83m7empa6qu2vspqjkpw4
  • Ethereum: 0xc0C5aCdB0E6c560132c93Df721E1Cd220f6fD4aa

If you wish to financially support us through other means you can best start a conversation with us by sending an email to hello@plabayo.tech.

Premium Partners

rama (γƒ©γƒž) is bundled with Http/Tls emulation data, gathered for all major platforms and browsers using real devices by BrowserStack. It does this automatically every day by using our public Fingerprinting service which is hosted together with a database on fly.io.

We are grateful to both sponsors for sponsering us these cloud resources.

Other Partners

  • SignPath.io: provides authoritative code signing for the windows rama CLI;

Professional Services

🀝 Enterprise support, software customisations, integrations, professional support, consultancy and training are available upon request by sending an email to hello@plabayo.tech. Or get an enterprise subscription via GitHub Sponsors.

See For organisations for an overview of our support, consulting and feature development services.

rama is licensed as both MIT and Apache 2.0. You are free to use and modify the code for any purpose, including commercial use. If Rama becomes an important part of your stack, we invite you to consider supporting the project as a sponsor or partner.

🌱 | Alternatives

While there are a handful of proxies written in Rust, there are only two other Rust frameworks specifically made for proxy purposes. All other proxy codebases are single purpose code bases, some even just for learning purposes. Or are actually generic http/web libraries/frameworks that facilitate proxy features as an extra.

Cloudflare has been working on a proxy service framework, named pingora, since a couple of years already, and on the 28th of February of 2024 they also open sourced it.

rama is not for everyone, but we sure hope it is right for you. If not, consider giving pingora a try, it might very well be the next best thing for you.

Secondly, ByteDance has an open source proxy framework written in Rust to develop forward and reverse proxies alike, named g3proxy.

❓| FAQ

Available at https://ramaproxy.org/book/faq.html.

⭐ | Stargazers

Star History Chart

original (OG) rama logo

Tip

πŸ“š If you like rama, you might also like Netstack.FM. the NetstackFM podcast.