Proxygen

Proxygen: Open Source HTTP Framework From Facebook

Facebook on 5th November announced the release of Proxygen, an open-source framework comprising of bundle of C++ HTTP Libraries and an easy-to-deploy HTTP Server. The motive behind the release of Proxygen is to give other developers the chance to build extremely flexible HTTP servers.

Proxygen comes with full support for HTTP/1.1, SPDY/3 and SPDY/3.1. Facebook is currently working on developing support for HTTP/2.

Facebook has open sourced most of its code for the developers, recently addition to the list is technology behind paper app.

So do they want to remove Apache or Nginx from the server race? Not yet! Proxygen is here to add flexibility to the new project rather than rebuild the whole idea of servers and their implementation.

Proxygen focuses mainly on the providing high-performance C++ framework that can easily be integrated into existing application.

From the Facebook blog

We want to help more people build and deploy high performance C++ HTTP services, and we believe that Proxygen is a great framework to do so.

The development started 4 years ago with emphasis on generating proxies(Proxygen) but later on it changed drastically to evolve into the software stacks like Apache, Nginx etc. In other words, it began as a high-performance HTTP(S) reverse-proxy load balancer.

The Facebook Blog also discussed on different reasons why one should build their own HTTP stack. The main points on which they stressed are Integration, Code reuse, Scale and Features. Proxygen is very active inside Facebook products and it is used in collaboration with Thrift, simplifying integration with existing systems.

Proxygen has already been used internally on many projects at Facebook such as Haystack, HTTP load balancers, HHVM and few of their mobile infrastructure. Highly scalable solutions can be achieved by using Proxygen in the project.

According to the blog, facebook engineering team is also interested in incorporating features such as WebSockets, SPDY, HTTP/1.1 and many more into Proxygen.

Proxygen: The Architecture

Proxygen features a four-layer abstraction. They are

  • Session
  • Codec
  • Transaction
  • Handler

For each alive connection, a session is created. A Codec resides within a session which takes care of serialization and de-serialization of HTTP messages. Codec is basically a protocol-specific object. Then the session takes care of mapping each message with particular HTTP transaction. Proxygen provides the API for the users such that a handler is provided which in turn registers for HTTP-specific callbacks during a single transactions.

Proxygen

The architecture supports SPDY and HTTP/2 with no code to add into any project.

The framework provides a simple, intuitive and fast-out-of-the-box solution for event-driven purposes.

Facebook is moving towards Open Sourcing their technology and this gives an opportunity for the developers to use cutting edge technology developed at facebook. The blog also mentioned that Facebook is moving with the drift of open source and will keep releasing more advanced framework and tools to the developers.

Source: Facebook Blog

Image Courtesy: Facebook Blog

2 thoughts on “Proxygen: Open Source HTTP Framework From Facebook”

Leave a Comment

Your email address will not be published. Required fields are marked *