JS code at the network edge. Oh, you're still here and not running, screaming? Read on

Cloudflare Workers offered to customize content


Bit caching biz Cloudflare on Friday teased website publishers with the prospect of being able to run JavaScript at the edge of its content delivery network, a capability that promises performance, security, and reliability improvements.

The outfit puts copies of customers' websites and content at various locations around the globe to enable speedy delivery and provides an efficient path to customer servers. It also does other things, like protect against malicious web traffic.

Making its edge points programmable would be appealing to customers, because it would allow them to run code designed to address local issues that aren't necessarily relevant elsewhere.

One way to do this, explained Cloudflare tech lead Kenton Varda, would be to run virtual machines or containers for every customer endpoint, but that would be expensive and complicated.

Instead, Varda has developed a scheme to run JavaScript using the Service Worker API, which runs code as a background processes.

"Service Workers were designed to run in browsers, but it turns out that the Service Worker API is a perfect fit for what we wanted to support on the edge," he explained in a blog post.

On Friday, Cloudflare began accepting signups for those interested in beta testing Cloudflare Service Workers, server-side JavaScript code executed using the V8 JavaScript engine developed for Google Chrome.

These Service Workers intercept incoming HTTP requests sent to a customer's domain and can return an HTTP response or make outbound HTTP requests to any other public internet address.

They allow site publishers to do things like put HTML templates at the edge of Cloudflare's CDN and only fetch dynamic content from company servers, or craft custom security rules, or implement customized load balancing and failover logic.

Varda says Cloudflare considered other possibilities such as Lua, virtual machines, containers, and Vx32 sandboxing. But JavaScript and V8 won out because the V8 engine's code is heavily scrutinized by Google for security, JavaScript is ubiquitous and V8's support for WebAssembly means other languages can be supported.

Node.js, a JavaScript runtime that relies on V8, was also considered but using it would mean losing V8's sandboxing.

The Cloudflare Workers Playground, which sounds like socialist vacation spot, turns out to be a place where the curious can try out some code. Interested parties may wish to petition for beta access. ®

Narrower topics


Other stories you might like

  • Lonestar plans to put datacenters in the Moon's lava tubes
    How? Founder tells The Register 'Robots… lots of robots'

    Imagine a future where racks of computer servers hum quietly in darkness below the surface of the Moon.

    Here is where some of the most important data is stored, to be left untouched for as long as can be. The idea sounds like something from science-fiction, but one startup that recently emerged from stealth is trying to turn it into a reality. Lonestar Data Holdings has a unique mission unlike any other cloud provider: to build datacenters on the Moon backing up the world's data.

    "It's inconceivable to me that we are keeping our most precious assets, our knowledge and our data, on Earth, where we're setting off bombs and burning things," Christopher Stott, founder and CEO of Lonestar, told The Register. "We need to put our assets in place off our planet, where we can keep it safe."

    Continue reading
  • Conti: Russian-backed rulers of Costa Rican hacktocracy?
    Also, Chinese IT admin jailed for deleting database, and the NSA promises no more backdoors

    In brief The notorious Russian-aligned Conti ransomware gang has upped the ante in its attack against Costa Rica, threatening to overthrow the government if it doesn't pay a $20 million ransom. 

    Costa Rican president Rodrigo Chaves said that the country is effectively at war with the gang, who in April infiltrated the government's computer systems, gaining a foothold in 27 agencies at various government levels. The US State Department has offered a $15 million reward leading to the capture of Conti's leaders, who it said have made more than $150 million from 1,000+ victims.

    Conti claimed this week that it has insiders in the Costa Rican government, the AP reported, warning that "We are determined to overthrow the government by means of a cyber attack, we have already shown you all the strength and power, you have introduced an emergency." 

    Continue reading
  • China-linked Twisted Panda caught spying on Russian defense R&D
    Because Beijing isn't above covert ops to accomplish its five-year goals

    Chinese cyberspies targeted two Russian defense institutes and possibly another research facility in Belarus, according to Check Point Research.

    The new campaign, dubbed Twisted Panda, is part of a larger, state-sponsored espionage operation that has been ongoing for several months, if not nearly a year, according to the security shop.

    In a technical analysis, the researchers detail the various malicious stages and payloads of the campaign that used sanctions-related phishing emails to attack Russian entities, which are part of the state-owned defense conglomerate Rostec Corporation.

    Continue reading

Biting the hand that feeds IT © 1998–2022