Rama 0.4: System proxy and PAC support
Six weeks aft the merchandise of 0.3 — nicely wrong the promised two-to-eight-week merchandise train model — we are proud and happy to person shipped rama 0.4. It's a merchandise that I americium very happy with, arsenic we were not only capable to make tons of improvements present and there, but besides sewage to activity connected immoderate items that had been connected our backlog for a agelong time.
For method specifications please publication the afloat CHANGELOG — including the rama 0.4 merchandise notes — astatine https://github.com/plabayo/rama/blob/main/CHANGELOG.md. And astatine immoderate clip you tin find a summary of what protocols and different features are supported successful Rama astatine https://ramaproxy.org/#features.
System Proxy Configuration
Rama has had support for HTTP, HTTP complete TLS (HTTPS) and SOCKS5 proxies for a agelong time. The easiest measurement is to configure them straight utilizing ProxyRoute(s) (what utilized to beryllium straight inserted arsenic a ProxyAddress). Within applications these tin beryllium hardcoded aliases exposed via a mounting somehow. An illustration of this is your browser aliases editor, which allows you to configure a proxy via a settings record aliases its GUI. You tin publication much astir this attack successful the "Application Proxies" chapter of the Rama book.
Applications often besides support the HTTP_PROXY situation variable. curl uses the lowercase http_proxy version alternatively for CGI reasons, a normal we now besides travel by default erstwhile utilizing the ProxyEnvLayer. That said, location are much communal env variables, specified arsenic ALL_PROXY, HTTPS_PROXY and NO_PROXY, pinch the second utilized to adhd bypass rules to, for example, guarantee immoderate (sub)domains do not spell via a proxy. All of these are now besides supported, via the ProxyEnvLayer and NoProxyEnvLayer.
However, arsenic you mightiness beryllium aware, operating systems besides let you to configure a proxy system-wide. Here 1 tin configure HTTP, HTTPS and SOCKS5 proxies, arsenic good arsenic bypass rules for what not to proxy. This is each very akin to the env variables discussed earlier, but system-wide. Of course, successful general, thing forces an app to respect these strategy configuration settings, either because it does not want to aliases because it simply does not person the built-in capacity to do truthful (which was the lawsuit for web clients built utilizing rama, until now). With rama 0.4 this is supported retired of the container via the SystemProxyLayer; you tin study much astir really these settings activity successful the "System Proxies" chapter of the Rama book.
System configuration settings besides let you to person a proxy beryllium dynamically selected utilizing a JavaScript file. This is known arsenic Proxy Auto Configuration, aliases PAC for short. To do truthful 1 must person a JavaScript runtime — not thing rama shipped anterior to rama 0.4. Now we do. With rama-js we now support moving a JavaScript runtime wrong a WASM runtime (using wasmtime, the runtime we will besides usage successful the early to build rama-wasm). This is important arsenic it provides isolation, ensuring that if our JavaScript runtime crashes it doesn't return the full process pinch it. Applications for illustration Google Chrome tally their JavaScript motor successful a abstracted OS process; wrong the Rama model we person chosen to do truthful wrong a WASM runtime instead. Same isolation, but without having to someway let immoderate exertion built utilizing Rama to tally and bundle a abstracted process.
Rama now has PAC support, via the rama-pac crate, which allows you to person a PAC runtime, and frankincense measure PAC scripts, but besides to easy make scripts for cases wherever each you want is the expertise to way domains X to proxy rules Y.
If you want to play pinch these caller rama model capabilities, you tin besides easy do truthful pinch our bid statement exertion (CLI), which you tin study really to instal successful the "rama binary" chapter of the Rama book:
- Client nonstop commands support it retired of the container (unless you overwrite it pinch env variables aliases a bid argument);
- There are now rama pac subcommands allowing you to make a PAC book arsenic good arsenic to measure a PAC book via a REPL. The second is particularly nice, arsenic anterior to this the only environments successful which you could play pinch a PAC record were beautiful aged and obscure applications... Another bully summation to our web CLI toolkit if you inquire me.
ttRPC and gRPC
Protocol-wise, rama now besides has support for ttRPC, via the caller rama-ttrpc crate. You tin spot it arsenic a lightweight replacement to gRPC that runs straight connected apical of a carrier protocol specified arsenic TCP, but still via a protobuf (proto) contract.
This is not the only caller crate wrong this abstraction however, arsenic we now besides person the rama-grpc-macros crate, bringing rama the expertise to make client- and server-side gRPC codification without penning a azygous statement of proto, relying alternatively connected your ain codecs, optionally driven by Serde (see define_service). Great for those that already usage gRPC and are successful power of their full stack.
HAR WebSockets
It turns retired that HAR (HTTP Archive) has support for WebSocket data. This last-minute rama 0.4 astonishment came to our attraction acknowledgment to a commercialized partner. It's an obscure characteristic though: it was added to Chrome immoderate years ago, but not galore different applications person picked it up truthful far. As specified we person mostly utilized Chrome arsenic our oracle to guideline our implementation.
It is now supported, and it besides made america realise that our erstwhile HAR export implementation was keeping excessively overmuch information successful representation for consistency and ordering purposes. This is each settled now, and we tin watercourse each your HTTP and WS information nicely to disk, without having to buffer the full watercourse into representation first.
The Rama CLI nonstop bid now besides has support for exporting a HAR record of the HTTP/WS conversations that you executed. In bid to do truthful you tin make usage of the --har argument.
Other changes and improvements
There are respective breaking changes and plentifulness of improvements. For a afloat database please spot the changelog. But to sanction a fewer here:
- Our peekers (used to cheque what protocol is flowing complete a carrier stream, spot the "Protocol Inspection" chapter of the Rama book) are now capable to neglect arsenic accelerated arsenic a byte tin nary longer fulfill the heuristics, and they besides received immoderate insignificant bug fixes. The HTTP peek router tin now besides opt successful to skipping "method" names that are commonly utilized and tin beryllium confused pinch HTTP header lines. In immoderate cases, specified arsenic PING, these tin needlessly stall the peeker logic until its timeout, which is not ideal. Using this other configuration should forestall astir of specified separator cases, if not all.
- This merchandise besides brings immoderate much improvements to our Apple Network Extension support, which I'm judge are greatly appreciated by those relying upon it to build L4 and L3 proxies for Apple platforms.
- Our (client) connection services now person a somewhat different trait signature, which allows for nicer correction handling and smarter determination making, for illustration knowing erstwhile to retry and erstwhile to neglect for real.
- In usability of PAC, you tin now insert aggregate proxy routes (addresses) into your input extensions, which will beryllium tried successful the bid given. The existing proxy DB functionality now besides happily makes usage of this by default, but if you want the aged random single-proxy action behaviour you tin still opt successful to that.
Thank you
We would for illustration to return this merchandise arsenic an opportunity to convey everyone that made and continues to make Rama possible: our contributors, the projects that we dangle upon arsenic good arsenic those that we forked, the wider Tokio and Rust ecosystem, our Sponsors and of people our Commercial Partners.
We very overmuch look guardant to the releases that are yet to come.
You tin besides subscribe to this Blog RSS feed aliases subscribe to our very ain newsletter, written by america and your emails stored pinch privateness successful mind wrong our ain strategy made pinch Rama.
Are you building thing pinch Rama unsocial aliases pinch your organisation? Do stock it pinch america by email aliases Discord.
Be empowered. Be the change.
Source: https://github.com/plabayo/rama/discussions/1130.
English (US) ·
Indonesian (ID) ·